| Task: | Robotti |
| Sender: | rene |
| Submission time: | 2026-01-17 13:45:10 +0200 |
| Language: | Python3 (PyPy3) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.04 s | details |
| #2 | WRONG ANSWER | 0.04 s | details |
| #3 | WRONG ANSWER | 0.04 s | details |
| #4 | WRONG ANSWER | 0.04 s | details |
| #5 | WRONG ANSWER | 0.04 s | details |
| #6 | WRONG ANSWER | 0.04 s | details |
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: WRONG ANSWER
| input |
|---|
| 3 ./\ \./ \/. |
| correct output |
|---|
| 13 |
| user output |
|---|
| 6 |
Feedback: Incorrect character on line 1 col 1: expected "13", got "6"
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1 . |
| correct output |
|---|
| 1 |
| user output |
|---|
| 2 |
Feedback: Incorrect character on line 1 col 1: expected "1", got "2"
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 5 ./\/\ ..... ..... ..... ... |
| correct output |
|---|
| 25 |
| user output |
|---|
| 7 |
Feedback: Incorrect character on line 1 col 1: expected "25", got "7"
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 5 \\/\\ /\/\/ \\/\\ /\/\/ ... |
| correct output |
|---|
| 37 |
| user output |
|---|
| 3 |
Feedback: Incorrect character on line 1 col 2: expected "37", got "3"
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| 3 |
Feedback: Incorrect character on line 1 col 1: expected "2519", got "3"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 3 |
Feedback: Incorrect character on line 1 col 1: expected "917489", got "3"
