| Task: | Robotti |
| Sender: | alli |
| Submission time: | 2026-01-17 13:14:48 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 s | details |
| #4 | WRONG ANSWER | 0.00 s | details |
| #5 | WRONG ANSWER | 0.01 s | details |
| #6 | WRONG ANSWER | 0.29 s | details |
Code
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
char c[21][21];
int n, k = 0;
int d = -2;
void haku(int x, int y){
if (x == n && y == n+1) return;
cout << x << " " << y << " " << d << "\n";
k++;
if (c[y][x] == '\\'){
c[y][x] = '/';
if (d == -2){
d = 1;
haku(x+1,y);
}
else if (d == 2){
d = -1;
haku(x-1,y);
}
else if (d == 1){
d = -2;
haku(x,y+1);
}
else if (d == -1){
d = 2;
haku(x,y-1);
}
}
else if (c[y][x] == '/'){
c[y][x] = '\\';
if (d == -2){
d = -1;
haku(x-1,y);
}
else if (d == 2){
d = 1;
haku(x+1,y);
}
else if (d == 1){
d = 2;
haku(x,y-1);
}
else if (d == -1){
d = -2;
haku(x,y+1);
}
}
else if (c[y][x] == '.'){
if (d == -2)haku(x,y+1);
else if (d == 2) haku(x,y-1);
else if (d == 1) haku(x+1,y);
else if (d == -1) haku(x-1,y);
}
}
int main(){
cin >> n;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= n; j++){
cin >> c[i][j];
}
}
haku(1,1);
cout << k << "\n";
}Test details
Test 1 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 3 ./\ \./ \/. |
| correct output |
|---|
| 13 |
| user output |
|---|
| 1 1 -2 1 2 -2 2 2 1 3 2 1 3 1 2 ... |
Feedback: Output is longer than expected
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1 . |
| correct output |
|---|
| 1 |
| user output |
|---|
| 1 1 -2 1 |
Feedback: Output is longer than expected
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 5 ./\/\ ..... ..... ..... ... |
| correct output |
|---|
| 25 |
| user output |
|---|
| 1 1 -2 1 2 -2 1 3 -2 1 4 -2 1 5 -2 ... |
Feedback: Output is longer than expected
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 5 \\/\\ /\/\/ \\/\\ /\/\/ ... |
| correct output |
|---|
| 37 |
| user output |
|---|
| 1 1 -2 2 1 1 2 2 -2 3 2 1 3 1 2 ... |
Feedback: Output is longer than expected
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| 1 1 -2 2 1 1 2 2 -2 3 2 1 3 3 -2 ... |
Feedback: Output is longer than expected
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 1 1 -2 2 1 1 2 2 -2 3 2 1 3 3 -2 ... |
Feedback: Output is longer than expected
