CSES - Datatähti 2018 loppu - Results
Submission details
Task:Merkkijono
Sender:Kameli
Submission time:2018-01-18 13:47:53 +0200
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.07 sdetails
#20.08 sdetails
#30.07 sdetails
#40.07 sdetails
#50.07 sdetails

Code

a=list(input())
c=25
chars='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
op=[]
i=0
while a!=list('ABCDEFGHIJKLMNOPQRSTUVWXYZ'):
    if c==-25:
        print("".join(a))
        op.append("SWAP")
        break
    if a[1]==chars[c]:
        op.append("SWAP")
        a[0],a[1]=a[1],a[0]
    a=[a[25]]+a[0:25]
    op.append("MOVE")
    if a[0]==chars[c-1]:
        a=[a[25]]+a[0:25]
        op.append("MOVE")
        c-=1
    #print("".join(a),i,c)
    i+=1
print(len(op))
#exit()
for i in op:
    print(i)

Test details

Test 1

Verdict: ACCEPTED

input
ABCDEFGHIJKLMNOPQRSTUVWXYZ

correct output
0

user output
0

Test 2

Verdict:

input
ZYXWVUTSRQPONMLKJIHGFEDCBA

correct output
923
MOVE
MOVE
SWAP
MOVE
...

user output
DBCAZYXWVUTSRQPONMLKJIHGFE
2354
MOVE
SWAP
MOVE
...

Test 3

Verdict:

input
RPJMFWBHYQOTXUAENLDGZISCVK

correct output
611
SWAP
MOVE
MOVE
SWAP
...

user output
WBCGPNFIKUEXMTRLOHYDJASQVZ
1370
MOVE
MOVE
MOVE
...

Test 4

Verdict:

input
GWJSPBHANMXYFLKIDORVUCEZQT

correct output
659
MOVE
SWAP
MOVE
SWAP
...

user output
JBCPOZAHNMKFQTXWEGSVIYLURD
1537
MOVE
MOVE
MOVE
...

Test 5

Verdict:

input
BJYNFLKEIUCZMQHRAXOGWPSDTV

correct output
624
MOVE
SWAP
MOVE
SWAP
...

user output
TBCZQIYRUFVXDLAPHNMGKWEOSJ
1259
MOVE
MOVE
MOVE
...