Task: | Merkkijono |
Sender: | ufokurpitsa |
Submission time: | 2018-01-18 14:29:58 +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.09 s | details |
#3 | WRONG ANSWER | 0.06 s | details |
#4 | WRONG ANSWER | 0.08 s | details |
#5 | WRONG ANSWER | 0.06 s | details |
Code
d = {'A': 0, 'B': 1, 'C': 2, 'D': 3, 'E': 4, 'F': 5, 'G': 6, 'H': 7, 'I': 8, 'J': 9, 'K': 10, 'L': 11, 'M': 12, 'N': 13, 'O': 14, 'P': 15, 'Q': 16, 'R': 17, 'S': 18, 'T': 19, 'U': 20, 'V': 21, 'W': 22, 'X': 23, 'Y': 24, 'Z': 25, } s1 = input() s = [] for c in s1: s.append(c) print(str(s)) i = 0 co = 0 m = [] while True: #for aa in range(2): print(str(d.get(s[i])) + " " + str(d.get(s[(i+1)%26]))) if d.get(s[i]) != 25 and d.get(s[i]) > d.get(s[(i+1)%26]): t = s[i] s[i] = s[(i+1)%26] s[(i+1)%26] = t m.append(True) print(str(s)) co = 0 else: m.append(False) co += 1 #print("M") if co == 25: break #print(str(co)) i = (i+1) %26 print(str(i)) for i in range(26): if d.get(s[0]) == 0: break; m.append(False) print(str(len(m))) for x in m: if x: print("SWAP") else: print("MOVE") print(str(s))
Test details
Test 1
Verdict: ACCEPTED
input |
---|
ABCDEFGHIJKLMNOPQRSTUVWXYZ |
correct output |
---|
0 |
user output |
---|
['A', 'B', 'C', 'D', 'E', 'F',... |
Test 2
Verdict: WRONG ANSWER
input |
---|
ZYXWVUTSRQPONMLKJIHGFEDCBA |
correct output |
---|
923 MOVE MOVE SWAP MOVE ... |
user output |
---|
['Z', 'Y', 'X', 'W', 'V', 'U',... |
Test 3
Verdict: WRONG ANSWER
input |
---|
RPJMFWBHYQOTXUAENLDGZISCVK |
correct output |
---|
611 SWAP MOVE MOVE SWAP ... |
user output |
---|
['R', 'P', 'J', 'M', 'F', 'W',... |
Test 4
Verdict: WRONG ANSWER
input |
---|
GWJSPBHANMXYFLKIDORVUCEZQT |
correct output |
---|
659 MOVE SWAP MOVE SWAP ... |
user output |
---|
['G', 'W', 'J', 'S', 'P', 'B',... |
Test 5
Verdict: WRONG ANSWER
input |
---|
BJYNFLKEIUCZMQHRAXOGWPSDTV |
correct output |
---|
624 MOVE SWAP MOVE SWAP ... |
user output |
---|
['B', 'J', 'Y', 'N', 'F', 'L',... |