CSES - Datatähti 2025 alku - Results
Submission details
Task:Robotti
Sender:Belinda
Submission time:2024-11-08 21:30:53 +0200
Language:Python3 (PyPy3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
#20
Test results
testverdicttimegroup
#10.04 s1, 2details
#20.04 s1, 2details
#30.04 s1, 2details
#40.04 s1, 2details
#50.04 s1, 2details
#60.04 s1, 2details
#70.06 s1, 2details
#80.07 s1, 2details
#90.08 s1, 2details
#100.07 s1, 2details
#110.07 s1, 2details
#120.08 s2details
#130.07 s2details
#140.18 s2details
#150.23 s2details
#160.29 s2details
#170.05 s2details
#180.67 s2details
#19--2details
#20--2details
#210.05 s2details
#220.12 s2details
#23--2details
#24--2details

Code

huoneet_maara = int(input())
rakennus = input()
def simuloi():
    huone = 1
    kolikkohuone = []
    sijainti = []
    counter = 0
    askel = 0
    for kirjain in rakennus:
        if kirjain=='*':
            kolikkohuone.append(huone)
        if kirjain=='R':
            sijainti.append(huone)
        huone = huone + 1
    print (kolikkohuone, huone, sijainti)
    while len(sijainti) == 1 and len(kolikkohuone) != 0:
        lahin_kolikko = [kolikkohuone[min(range(len(kolikkohuone)), key=lambda i: abs(kolikkohuone[i] - sijainti[0]))]]
        #sum(lahin_kolikko, [])
        print(lahin_kolikko)
        if len(lahin_kolikko) == 1:
            kolikkohuone.remove(lahin_kolikko[0])
            counter = counter + 1
            askel = askel + abs(lahin_kolikko[0]- sijainti[0])
            sijainti = lahin_kolikko

    return kolikkohuone, sijainti, counter, askel


print(simuloi())

Test details

Test 1

Group: 1, 2

Verdict:

input
1
R

correct output
0 0

user output
[] 2 [1]
([], [1], 0, 0)

Test 2

Group: 1, 2

Verdict:

input
10
...R......

correct output
0 0

user output
[] 11 [4]
([], [4], 0, 0)

Test 3

Group: 1, 2

Verdict:

input
10
**.R...***

correct output
12 5

user output
[1, 2, 8, 9, 10] 11 [4]
[2]
[1]
[8]
[9]
...

Test 4

Group: 1, 2

Verdict:

input
10
***R******

correct output
0 0

user output
[1, 2, 3, 5, 6, 7, 8, 9, 10] 1...

Test 5

Group: 1, 2

Verdict:

input
1000
R................................

correct output
947 9

user output
[149, 227, 258, 429, 495, 574,...

Test 6

Group: 1, 2

Verdict:

input
1000
.................................

correct output
886 9

user output
[114, 232, 530, 612, 709, 713,...

Test 7

Group: 1, 2

Verdict:

input
1000
.....*..*....**..**..*......*....

correct output
1287 400

user output
[6, 9, 14, 15, 18, 19, 22, 29,...

Test 8

Group: 1, 2

Verdict:

input
1000
************.*****************...

correct output
0 0

user output
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10...

Test 9

Group: 1, 2

Verdict:

input
1000
******************************...

correct output
0 0

user output
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10...

Test 10

Group: 1, 2

Verdict:

input
1000
R*****************************...

correct output
999 999

user output
[2, 3, 4, 5, 6, 7, 8, 9, 10, 1...

Test 11

Group: 1, 2

Verdict:

input
1000
******************************...

correct output
999 999

user output
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10...

Test 12

Group: 2

Verdict:

input
10000
.......**........*...........*...

correct output
10971 999

user output
[8, 9, 18, 30, 42, 57, 62, 71,...

Test 13

Group: 2

Verdict:

input
10000
*..*....*......*.....*..*........

correct output
9999 999

user output
[1, 4, 9, 16, 22, 25, 36, 44, ...

Test 14

Group: 2

Verdict:

input
10000
*.*.*...**.*...*....**.**.**.....

correct output
18766 5000

user output
[1, 3, 5, 9, 10, 12, 16, 21, 2...

Test 15

Group: 2

Verdict:

input
10000
R*****************************...

correct output
9999 9999

user output
[2, 3, 4, 5, 6, 7, 8, 9, 10, 1...

Test 16

Group: 2

Verdict:

input
10000
******************************...

correct output
9999 9999

user output
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10...

Test 17

Group: 2

Verdict:

input
200000
.................................

correct output
0 0

user output
[] 200001 [100001]
([], [100001], 0, 0)

Test 18

Group: 2

Verdict:

input
200000
.................................

correct output
299934 10000

user output
[46, 49, 78, 81, 82, 104, 111,...

Test 19

Group: 2

Verdict:

input
200000
**.***....**..**.....***.*..*....

correct output
299998 100000

user output
(empty)

Test 20

Group: 2

Verdict:

input
200000
******************************...

correct output
0 0

user output
(empty)

Test 21

Group: 2

Verdict:

input
200000
R................................

correct output
133765 3

user output
[70143, 84565, 133766] 200001 ...

Test 22

Group: 2

Verdict:

input
200000
R................................

correct output
199982 5000

user output
[67, 82, 107, 231, 242, 279, 2...

Test 23

Group: 2

Verdict:

input
200000
R*****************************...

correct output
199999 199999

user output
(empty)

Test 24

Group: 2

Verdict:

input
200000
******************************...

correct output
199999 199999

user output
(empty)