Task: | Merkkijono |
Sender: | Kurns |
Submission time: | 2018-01-18 15:57:13 +0200 |
Language: | Python2 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.08 s | details |
#2 | WRONG ANSWER | 0.06 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | WRONG ANSWER | 0.08 s | details |
#5 | WRONG ANSWER | 0.06 s | details |
Code
UI = raw_input() operaatiot = [] siirrot = 0 def arvo(x): if x == "A": return "TOPKEK" if x == "B": return "A" if x == "C": return "B" if x == "D": return "C" if x == "E": return "D" if x == "F": return "E" if x == "G": return "F" if x == "H": return "G" if x == "I": return "H" if x == "J": return "I" if x == "K": return "J" if x == "L": return "K" if x == "M": return "L" if x == "N": return "M" if x == "O": return "N" if x == "P": return "O" if x == "Q": return "P" if x == "R": return "Q" if x == "S": return "R" if x == "T": return "S" if x == "U": return "T" if x == "V": return "U" if x == "W": return "V" if x == "X": return "W" if x == "Y": return "X" if x == "Z": return "Y" def swap(): eka = str(UI[0]) toka = str(UI[1]) operaatiot.append("SWAP") return str(toka) + str(eka) + str(UI[2:]) def vikaekaksi(): stringi = UI vika = stringi[-1] res = str(vika) + str(stringi[:-1]) operaatiot.append("MOVE") return res while True: if arvo(UI[0]) == UI[1]: UI = swap() siirrot += 1 elif arvo(UI[0]) == arvo(UI[-1]): UI = vikaekaksi siirrot += 1 else: break print "UI on",UI 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: WRONG ANSWER
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
UI on YZXWVUTSRQPONMLKJIHGFEDC... |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
0 |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
0 |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
0 |