| Task: | Robotti |
| Sender: | alli |
| Submission time: | 2026-01-17 13:15:06 +0200 |
| Language: | C++ (C++20) |
| 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.00 s | details |
| #4 | WRONG ANSWER | 0.00 s | details |
| #5 | WRONG ANSWER | 0.00 s | details |
| #6 | WRONG ANSWER | 0.01 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: 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 |
|---|
| 38 |
Feedback: Incorrect character on line 1 col 2: expected "37", got "38"
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| 2520 |
Feedback: Incorrect character on line 1 col 3: expected "2519", got "2520"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 917490 |
Feedback: Incorrect character on line 1 col 5: expected "917489", got "917490"
