CSES - Datatähti 2018 loppu - Results
Submission details
Task:Tietoverkko
Sender:Kurns
Submission time:2018-01-18 15:34:13 +0200
Language:Python2
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.07 s1details
#20.08 s1details
#30.06 s1details
#40.07 s1details
#5ACCEPTED0.07 s1details
#60.09 s2details
#70.06 s2details
#80.08 s2details
#90.06 s2details
#10ACCEPTED0.06 s2details

Code

UI = raw_input()
operaatiot = []
siirrot = 0

def arvo(x):
    if x == "A":
        return 0
    if x == "B":
        return 1
    if x == "C":
        return 2
    if x == "D":
        return 3
    if x == "E":
        return 4
    if x == "F":
        return 5
    if x == "G":
        return 6
    if x == "H":
        return 7
    if x == "I":
        return 8
    if x == "J":
        return 9
    if x == "K":
        return 10
    if x == "L":
        return 11
    if x == "M":
        return 12
    if x == "N":
        return 13
    if x == "O":
        return 14
    if x == "P":
        return 15
    if x == "Q":
        return 16
    if x == "R":
        return 17
    if x == "S":
        return 18
    if x == "T":
        return 19
    if x == "U":
        return 20
    if x == "V":
        return 21
    if x == "W":
        return 22
    if x == "X":
        return 23
    if x == "Y":
        return 24
    if x == "Z":
        return 25
        
def swap():
    eka = str(UI[0])
    toka = str(UI[1])
    operaatiot.append("SWAP")
    return str(toka) + str(eka) + str(UI[2:])
    
def vikaekaksi():
    stringi = UI
    vika = stringi[-1]
    res = str(vika) + str(stringi[:-1])
    operaatiot.append("MOVE")
    return res


while True:
    if arvo(UI[0]) > arvo(UI[1]):
        UI = swap()
        siirrot += 1
    elif arvo(UI[0]) > arvo(UI[-1]):
        UI = vikaekaksi()
        siirrot += 1
    else:
        break
    print UI
        
print siirrot

for c in range(0, len(operaatiot)):
    print operaatiot[c]

Test details

Test 1

Group: 1

Verdict:

input
100
16 88
6 77
60 92
98 64
...

correct output
97

user output
0

Test 2

Group: 1

Verdict:

input
100
97 41
95 93
79 60
5 4
...

correct output
95

user output
0

Test 3

Group: 1

Verdict:

input
100
87 24
21 49
86 85
42 32
...

correct output
90

user output
0

Test 4

Group: 1

Verdict:

input
100
30 24
54 79
51 6
80 29
...

correct output
50

user output
0

Test 5

Group: 1

Verdict: ACCEPTED

input
100
11 27
54 59
100 90
2 95
...

correct output
0

user output
0

Test 6

Group: 2

Verdict:

input
100000
98276 76171
70684 49183
48756 661
17166 16972
...

correct output
99997

user output
0

Test 7

Group: 2

Verdict:

input
100000
35903 47275
13566 84
58018 42495
57071 4451
...

correct output
99995

user output
0

Test 8

Group: 2

Verdict:

input
100000
79209 94485
60266 86793
27501 19927
13544 59730
...

correct output
99000

user output
0

Test 9

Group: 2

Verdict:

input
100000
68402 82703
12892 46068
60013 40753
26168 34434
...

correct output
90000

user output
0

Test 10

Group: 2

Verdict: ACCEPTED

input
100000
37330 74855
54324 45726
61652 15611
79081 47339
...

correct output
0

user output
0