Task: | Merkkijono |
Sender: | Kisse |
Submission time: | 2018-01-18 15:00:24 +0200 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.08 s | details |
#2 | WRONG ANSWER | 0.10 s | details |
#3 | WRONG ANSWER | 0.10 s | details |
#4 | WRONG ANSWER | 0.07 s | details |
#5 | WRONG ANSWER | 0.07 s | details |
Code
ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" String = input() MoveList = [] I = 0 while 42: Start = String.find("A") Seg = "A" J = 0 while len(Seg) < 26: J += 1 if Seg + String[(Start + J) % 26] in ABC: Seg = Seg + String[(Start + J) % 26] else: break if len(Seg) == 26: break if (ABC.index(String[I]) - ABC.index(String[I + 1]) > 0): String = String.replace(String[I:I + 2], String[I + 1] + String[I]) MoveList.append("SWAP") MoveList.append("MOVE") I = (I + 1) % 25 print(len(MoveList)) for L in MoveList: print(L)
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 |
---|
926 SWAP MOVE SWAP MOVE ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
674 SWAP MOVE SWAP MOVE ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
596 MOVE SWAP MOVE SWAP ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
611 MOVE MOVE SWAP MOVE ... |