Submission details
Task:Robotti
Sender:rene
Submission time:2026-01-17 13:44:53 +0200
Language:Python3 (PyPy3)
Status:READY
Result:0
Feedback
groupverdictscore
#10
Test results
testverdicttime
#10.04 sdetails
#20.04 sdetails
#30.04 sdetails
#40.04 sdetails
#50.04 sdetails
#60.04 sdetails

Code

import time
square = int(input())
ruudukko = []

robotti_x = 0
robotti_y = -1

def check_if_robot_outside(n, x, y):
    if x > n-1:
        return False
    elif x < 0:
        return False
    elif y > n-1:
        return False
    elif y < 0:
        return False
    else:
        return True

for i in range(square):
    rivi = input()
    riviarray = []
    for i in range(len(rivi)):
        riviarray.append(rivi[i])
    ruudukko.append(riviarray)

print(square)
print(ruudukko)

move = True
next_move_left = False
next_move_right = False
next_move_up = False
next_move_down = False
moves = 0
skip = False
robotti_y = -1

print(robotti_x, robotti_y)

while move == True:
    if next_move_left:
        next_move_left = False
        robotti_x = robotti_x - 1
        move = check_if_robot_outside(square, robotti_x, robotti_y)
        moves = moves + 1
        
        if move == True:
            inner = ruudukko[robotti_y]
            inspect = inner[robotti_x]

            if inspect == "/":
                next_move_down = True
                ruudukko[robotti_y][robotti_x] = "\\"
                skip = True
            elif inspect == "\\":
                next_move_up = True
                ruudukko[robotti_y][robotti_y] = "/"
                skip = True

            skip = False
            print(robotti_x, robotti_y)

    elif next_move_right:
        next_move_right = False
        robotti_x = robotti_x + 1
        move = check_if_robot_outside(square, robotti_x, robotti_y)
        moves = moves + 1

        if move == True:
            inner = ruudukko[robotti_y]
            inspect = inner[robotti_x]

            if inspect == "/":
                next_move_up = True
                ruudukko[robotti_y][robotti_x] = "\\"
                skip = True
            elif inspect == "\\":
                next_move_down = True
                ruudukko[robotti_y][robotti_x] = "/"
                skip = True

            skip = False
            print(robotti_x, robotti_y)

    elif next_move_down == True:
        next_move_down = False
        robotti_y = robotti_y - 1
        move = check_if_robot_outside(square, robotti_x, robotti_y)
        moves = moves + 1

        if move == True:
            inner = ruudukko[robotti_y]
            inspect = inner[robotti_x]

            if inspect == "/":
                next_move_left = True
                ruudukko[robotti_y][robotti_x] = "\\"
                skip = True
            elif inspect == "\\":
                next_move_right = True
                ruudukko[robotti_y][robotti_x] = "/"
                skip = True

            skip = False
            print(robotti_x, robotti_y)

    elif next_move_up == True:
        next_move_up = False
        robotti_y = robotti_y + 1
        move = check_if_robot_outside(square, robotti_x, robotti_y)
        moves = moves + 1
        
        if move == True:
            inner = ruudukko[robotti_y]
            inspect = inner[robotti_x]

            if inspect == "/":
                next_move_right = True
                ruudukko[robotti_y][robotti_x] = "\\"
                skip = True
            elif inspect == "\\":
                next_move_left = True
                ruudukko[robotti_y][robotti_x] = "/"
                skip = True

            skip = False
            print(robotti_x, robotti_y)

    else:
        robotti_y = robotti_y + 1
        move = check_if_robot_outside(square, robotti_x, robotti_y)
        moves = moves + 1

        if move == True:
            inner = ruudukko[robotti_y]
            inspect = inner[robotti_x]

            if inspect == "/":
                next_move_left = True
                ruudukko[robotti_y][robotti_x] = "\\"
                skip = True
            elif inspect == "\\":
                next_move_right = True
                ruudukko[robotti_y][robotti_x] = "/"
                skip = True

            skip = False
            print(robotti_x, robotti_y)

print(moves)

Test details

Test 1 (public)

Verdict:

input
3
./\
\./
\/.

correct output
13

user output
3
[['.', '/', '\\'], ['\\', '.',...

Feedback: Output is longer than expected

Test 2

Verdict:

input
1
.

correct output
1

user output
1
[['.']]
0 -1
0 0
2

Feedback: Output is longer than expected

Test 3

Verdict:

input
5
./\/\
.....
.....
.....
...

correct output
25

user output
5
[['.', '/', '\\', '/', '\\'], ...

Feedback: Output is longer than expected

Test 4

Verdict:

input
5
\\/\\
/\/\/
\\/\\
/\/\/
...

correct output
37

user output
5
[['\\', '\\', '/', '\\', '\\']...

Feedback: Output is longer than expected

Test 5

Verdict:

input
20
\\/\/\/\\./\\.\/\/\.
/\\\\\\/\\\\\\\\\\\.
\\\\\\\\\\\\\\\\\\\\
/\\\\\\\\\\\\\.\\\\\
...

correct output
2519

user output
20
[['\\', '\\', '/', '\\', '/', ...

Feedback: Output is longer than expected

Test 6

Verdict:

input
20
\\..................
.\\..............\\.
..\\............\\..
...\\..........\\...
...

correct output
917489

user output
20
[['\\', '\\', '.', '.', '.', '...

Feedback: Output is longer than expected