Task: | Merkkijono |
Sender: | inkeri |
Submission time: | 2018-01-18 13:47:52 +0200 |
Language: | Python3 |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | WRONG ANSWER | 0 |
test | verdict | time | |
---|---|---|---|
#1 | ACCEPTED | 0.07 s | details |
#2 | WRONG ANSWER | 0.07 s | details |
#3 | WRONG ANSWER | 0.09 s | details |
#4 | WRONG ANSWER | 0.07 s | details |
#5 | WRONG ANSWER | 0.07 s | details |
Code
a = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ") b = list(input()) c = [] n = 0 d = ["SWAP\n", "MOVE\n", "MOVE\nSWAP\n"] for i in range(1, 27): x = b.index(a[-i]) if x == 0: continue if x == 1: c.append(d[0]) n+=1 b[0], b[1] = b[1], b[0] else: c.append(d[2] * (26 - x)) n += 2 * (26-x) c.append(d[1]) n += 1 b = [b[x]] + b[:i] + b[x+1:] + b[i:x] print(n) print("".join(c))
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
78 MOVE SWAP MOVE MOVE ... |
Test 2
Verdict: WRONG ANSWER
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
579 SWAP MOVE SWAP MOVE ... |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
364 MOVE SWAP MOVE SWAP ... |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
404 MOVE SWAP MOVE SWAP ... |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
380 MOVE SWAP MOVE SWAP ... |