Submission #1443540


Source Code Expand

N=int(input())
l=[int(input()) for _ in range(N)]
cnt=0
if(N<3):
    if N==1:print("0")
    elif l[0]>l[1]:print("1")
    else:print("0")
for _ in range(N):
    for i in range(N-2):
        if l[i]>l[i+2]:
            l[i], l[i + 2] = l[i + 2], l[i]
for _ in range(N):
    for i in range(N-1):
        if(l[i]>l[i+1]):
            l[i],l[i+1]=l[i+1],l[i]
            cnt+=1
print(cnt)


Submission Info

Submission Time
Task C - BBuBBBlesort!
User irobe_sama
Language Python (3.4.3)
Score 0
Code Size 406 Byte
Status WA
Exec Time 2104 ms
Memory 7084 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 600
Status
AC × 2
AC × 4
WA × 3
TLE × 17
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 TLE 2104 ms 7072 KB
02.txt TLE 2104 ms 7064 KB
03.txt TLE 2104 ms 7072 KB
04.txt TLE 2104 ms 7068 KB
05.txt TLE 2104 ms 7084 KB
06.txt TLE 2104 ms 7084 KB
07.txt TLE 2104 ms 7084 KB
08.txt TLE 2104 ms 7080 KB
09.txt TLE 2104 ms 7076 KB
10.txt TLE 2104 ms 7084 KB
11.txt TLE 2104 ms 7084 KB
12.txt TLE 2104 ms 7080 KB
13.txt TLE 2104 ms 7080 KB
14.txt TLE 2104 ms 7064 KB
15.txt TLE 2104 ms 7084 KB
16.txt TLE 2104 ms 7008 KB
17.txt TLE 2104 ms 7084 KB
18.txt WA 16 ms 3064 KB
19.txt WA 16 ms 3064 KB
20.txt WA 16 ms 3064 KB
21.txt AC 16 ms 3064 KB
22.txt AC 16 ms 3064 KB
s1.txt AC 16 ms 3064 KB
s2.txt AC 16 ms 3064 KB