Task: | Merkkijono |
Sender: | Kurns |
Submission time: | 2018-01-18 16:31:45 +0200 |
Language: | Python2 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | TIME LIMIT EXCEEDED | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.06 s | details |
#2 | TIME LIMIT EXCEEDED | -- | details |
#3 | TIME LIMIT EXCEEDED | -- | details |
#4 | TIME LIMIT EXCEEDED | -- | details |
#5 | TIME LIMIT EXCEEDED | -- | details |
Code
UI = raw_input() operaatiot = [] siirrot = 0 def swap(): eka = str(UI[0]) toka = str(UI[1]) operaatiot.append("SWAP") return str(toka) + str(eka) + str(UI[2:]) def vikaekaksi(): vika = UI[-1] res = str(vika) + str(UI[:-1]) operaatiot.append("MOVE") return res while siirrot < 10: if UI == "ABCDEFGHIJKLMNOPQRSTUVWXYZ": break if UI[0] > UI[1]: UI = swap() siirrot += 1 elif UI[0] > UI[-1]: UI = vikaekaksi() siirrot += 1 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: TIME LIMIT EXCEEDED
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
(empty) |
Test 3
Verdict: TIME LIMIT EXCEEDED
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
(empty) |
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) |