Submission #4262486
Source Code Expand
#include <bits/stdc++.h> using namespace std; int n, ans; struct node { int val, st; }a[100005]; bool cmp(node t, node b) { return t.val < b.val; } int main() { scanf ("%d", &n); for (int i = 1; i <= n; i++) { scanf ("%d", &a[i].val); a[i].st = i; } sort (a + 1, a + n + 1, cmp); for (int i = 1; i <= n; i++) { if ((a[i].st - i) % 2) ans++; } printf ("%d", ans/2); return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - BBuBBBlesort! |
User | vjudge4 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 395 Byte |
Status | RE |
Exec Time | 5 ms |
Memory | 592 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 600 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | s1.txt, s2.txt |
All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt, 17.txt, 18.txt, 19.txt, 20.txt, 21.txt, 22.txt, s1.txt, s2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01.txt | RE | 5 ms | 584 KB |
02.txt | RE | 4 ms | 592 KB |
03.txt | RE | 4 ms | 584 KB |
04.txt | RE | 4 ms | 584 KB |
05.txt | RE | 4 ms | 584 KB |
06.txt | RE | 4 ms | 592 KB |
07.txt | RE | 4 ms | 592 KB |
08.txt | RE | 4 ms | 592 KB |
09.txt | RE | 4 ms | 592 KB |
10.txt | RE | 4 ms | 584 KB |
11.txt | RE | 4 ms | 584 KB |
12.txt | RE | 4 ms | 584 KB |
13.txt | RE | 4 ms | 592 KB |
14.txt | RE | 4 ms | 584 KB |
15.txt | RE | 4 ms | 584 KB |
16.txt | RE | 4 ms | 584 KB |
17.txt | RE | 4 ms | 592 KB |
18.txt | RE | 4 ms | 584 KB |
19.txt | RE | 4 ms | 584 KB |
20.txt | RE | 4 ms | 584 KB |
21.txt | RE | 4 ms | 592 KB |
22.txt | RE | 4 ms | 580 KB |
s1.txt | RE | 4 ms | 584 KB |
s2.txt | RE | 4 ms | 584 KB |