| Task: | Robotti |
| Sender: | Linuzzik |
| Submission time: | 2026-01-17 13:26:46 +0200 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | ACCEPTED | 0.00 s | details |
| #2 | ACCEPTED | 0.00 s | details |
| #3 | ACCEPTED | 0.01 s | details |
| #4 | WRONG ANSWER | 0.00 s | details |
| #5 | WRONG ANSWER | 0.00 s | details |
| #6 | WRONG ANSWER | 0.00 s | details |
Code
#include<bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
vector<vector<int>> w(n, vector<int>(n));
for (int i = 0; i < n; i++) {
for (int j = 0; j < n; j++) {
char c; cin >> c;
if (c == '.') {}
else if (c == '/') w[i][j] = 2;
else w[i][j] = 1;
}
}
int y = 0, x = 0;
int dx = 0, dy = 1;
int t = 0;
while (x < n && y < n && x >= 0 && y >= 0) {
y += dy; x += dx;
t++;
if (x >= n || y >= n || x < 0 || y < 0) break;
if (w[y][x] == 1) {
if (dx != 0) {
dy = dx;
dx = 0;
} else if (dy != 0) {
dx = dy;
dy = 0;
}
w[y][x] = 2;
} else if (w[y][x] == 2) {
if (dx != 0) {
dy = -dx;
dx = 0;
} else if (dy != 0) {
dx = -dy;
dy = 0;
}
w[y][x] = 1;
}
}
cout << t << "\n";
}Test details
Test 1 (public)
Verdict: ACCEPTED
| input |
|---|
| 3 ./\ \./ \/. |
| correct output |
|---|
| 13 |
| user output |
|---|
| 13 |
Test 2
Verdict: ACCEPTED
| input |
|---|
| 1 . |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 |
Test 3
Verdict: ACCEPTED
| input |
|---|
| 5 ./\/\ ..... ..... ..... ... |
| correct output |
|---|
| 25 |
| user output |
|---|
| 25 |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 5 \\/\\ /\/\/ \\/\\ /\/\/ ... |
| correct output |
|---|
| 37 |
| user output |
|---|
| 2 |
Feedback: Incorrect character on line 1 col 1: expected "37", got "2"
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| 2 |
Feedback: Incorrect character on line 1 col 2: expected "2519", got "2"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 19 |
Feedback: Incorrect character on line 1 col 1: expected "917489", got "19"
