Task: | Merkkijono |
Sender: | Kurns |
Submission time: | 2018-01-18 16:48:29 +0200 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | RUNTIME ERROR | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.07 s | details |
#2 | RUNTIME ERROR | 0.07 s | details |
#3 | RUNTIME ERROR | 0.07 s | details |
#4 | TIME LIMIT EXCEEDED | -- | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
Code
UI = input() operaatiot = [] siirrot = 0 lista = [] for x in range(0, len(UI)): lista.append(UI[x]) def swap(): eka = str(lista[0]) toka = str(lista[1]) lista = lista.insert(toka, 0) del lista[2] operaatiot.append("SWAP") def vikaekaksi(): lista = lista vika = lista.pop() lista = lista.insert(vika, 0) operaatiot.append("MOVE") while siirrot < 100000: if UI[0] == "A" and UI[-1] == "Z": break if UI[0] > UI[1]: UI = swap() siirrot += 1 elif UI[0] > UI[-1]: UI = vikaekaksi() siirrot += 1 #print(lista) print(siirrot) for c in range(0, len(operaatiot)): print(operaatiot[c])
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
0 |
Test 2
Verdict: RUNTIME ERROR
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 26, in <module> UI = swap() File "input/code.py", line 10, in swap eka = str(lista[0]) UnboundLocalError: local variable 'lista' referenced before assignment
Test 3
Verdict: RUNTIME ERROR
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
(empty) |
Error:
Traceback (most recent call last): File "input/code.py", line 26, in <module> UI = swap() File "input/code.py", line 10, in swap eka = str(lista[0]) UnboundLocalError: local variable 'lista' referenced before assignment
Test 4
Verdict: TIME LIMIT EXCEEDED
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |
Test 5
Verdict: TIME LIMIT EXCEEDED
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
(empty) |