CSES - Datatähti 2018 loppu - Results
Submission details
Task:Merkkijono
Sender:Kisse
Submission time:2018-01-18 15:15:23 +0200
Language:Python3
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#1ACCEPTED0.07 sdetails
#2--details
#3--details
#4--details
#5--details

Code

ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
String = input()
MoveList = []
I = 0
while 42:
	if String == ABC:
		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")
	String = (String[-1] + String[0:-1])
	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:

input
ZYXWVUTSRQPONMLKJIHGFEDCBA

correct output
923
MOVE
MOVE
SWAP
MOVE
...

user output
(empty)

Test 3

Verdict:

input
RPJMFWBHYQOTXUAENLDGZISCVK

correct output
611
SWAP
MOVE
MOVE
SWAP
...

user output
(empty)

Test 4

Verdict:

input
GWJSPBHANMXYFLKIDORVUCEZQT

correct output
659
MOVE
SWAP
MOVE
SWAP
...

user output
(empty)

Test 5

Verdict:

input
BJYNFLKEIUCZMQHRAXOGWPSDTV

correct output
624
MOVE
SWAP
MOVE
SWAP
...

user output
(empty)