Submission #1593385
Source Code Expand
from collections import defaultdict, Counter from itertools import product, groupby, count, permutations, combinations from math import pi, sqrt from collections import deque from bisect import bisect, bisect_left, bisect_right INF = 10 ** 10 def ceil(a, b): return (a + b - 1) // b def main(): N = int(input()) A_list = list(sorted([(int(input()), i) for i in range(N)])) a_list = [i for a, i in A_list] ans = 0 for i, a in enumerate(a_list): ans += (i % 2 != a % 2) print(ceil(ans, 2)) if __name__ == '__main__': main()
Submission Info
Submission Time | |
---|---|
Task | C - BBuBBBlesort! |
User | MitI_7 |
Language | Python (3.4.3) |
Score | 600 |
Code Size | 592 Byte |
Status | AC |
Exec Time | 314 ms |
Memory | 18108 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 600 / 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 | AC | 314 ms | 18108 KB |
02.txt | AC | 306 ms | 18108 KB |
03.txt | AC | 298 ms | 18104 KB |
04.txt | AC | 300 ms | 18104 KB |
05.txt | AC | 301 ms | 18104 KB |
06.txt | AC | 300 ms | 18100 KB |
07.txt | AC | 298 ms | 18100 KB |
08.txt | AC | 219 ms | 17656 KB |
09.txt | AC | 210 ms | 17656 KB |
10.txt | AC | 221 ms | 17660 KB |
11.txt | AC | 213 ms | 17660 KB |
12.txt | AC | 222 ms | 17720 KB |
13.txt | AC | 223 ms | 17656 KB |
14.txt | AC | 302 ms | 18104 KB |
15.txt | AC | 305 ms | 18108 KB |
16.txt | AC | 310 ms | 18104 KB |
17.txt | AC | 309 ms | 18104 KB |
18.txt | AC | 21 ms | 3316 KB |
19.txt | AC | 21 ms | 3316 KB |
20.txt | AC | 21 ms | 3316 KB |
21.txt | AC | 21 ms | 3316 KB |
22.txt | AC | 21 ms | 3316 KB |
s1.txt | AC | 21 ms | 3316 KB |
s2.txt | AC | 21 ms | 3316 KB |