Task: | Järjestäminen |
Sender: | CursedTomb |
Submission time: | 2021-01-23 17:49:23 +0200 |
Language: | Python3 (PyPy3) |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
#2 | WRONG ANSWER | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | WRONG ANSWER | 0.06 s | 1, 2 | details |
#2 | RUNTIME ERROR | 0.08 s | 2 | details |
#3 | WRONG ANSWER | 0.10 s | 1, 2 | details |
#4 | WRONG ANSWER | 0.12 s | 1, 2 | details |
Code
t=int(input()) for i in range(t): n = int(input()) arr = list(input()) arr = [int(i) for i in arr if i != " "] arr2 = list(arr) arr2.sort() a = 1 while(arr is not arr2): t = arr.index(a) if(t==a): a+=1 continue if(t+1>=n): print("NO") break if(a==n): print("NO") break tmp1 = arr[a-1] tmp2 = arr[a] arr[a-1], arr[a]= arr[t], arr[t+1] arr[t], arr[t+1] = tmp1, tmp2 a+=1 if(a==n): if(arr2==arr): print("YES") else: print("NO") break
Test details
Test 1
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
153 1 1 2 1 2 ... |
correct output |
---|
YES YES NO NO NO ... |
user output |
---|
NO YES NO NO NO ... Truncated |
Test 2
Group: 2
Verdict: RUNTIME ERROR
input |
---|
1000 59 35 29 32 50 11 15 9 21 19 45 2... |
correct output |
---|
YES NO YES NO YES ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 12, in <module> t = ar...
Test 3
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
720 6 1 6 4 5 2 3 6 6 3 2 1 5 4 ... |
correct output |
---|
YES NO NO NO YES ... |
user output |
---|
NO NO NO NO NO ... Truncated |
Test 4
Group: 1, 2
Verdict: WRONG ANSWER
input |
---|
1000 8 7 4 2 8 6 3 5 1 8 3 8 2 7 5 4 6 1 ... |
correct output |
---|
NO NO YES NO YES ... |
user output |
---|
NO NO NO NO NO ... Truncated |