| Task: | Robotti |
| Sender: | Karjalanp11rakka |
| Submission time: | 2026-01-17 13:20:29 +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 | WRONG ANSWER | 0.00 s | details |
| #3 | WRONG ANSWER | 0.00 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 n;
char t[20][20];
int s {};
void search(int x, int y, int d)
{
++s;
if(x == n || x == -1 || y == n || y == -1) return;
if(t[x][y] == '.')
{
if(d == 0) search(x, y + 1, d);
else if(d == 1) search(x, y - 1, d);
else if(d == 2) search(x + 1, y, d);
else search(x - 1, y, d);
}
else if(t[x][y] == '/')
{
if(d == 0) search(x - 1, y, 3);
if(d == 1) search(x + 1, y, 2);
if(d == 2) search(x, y - 1, 1);
if(d == 3) search(x, y + 1, 0);
}
else
{
if(d == 1) search(x - 1, y, 3);
if(d == 0) search(x + 1, y, 2);
if(d == 3) search(x, y - 1, 1);
if(d == 2) search(x, y + 1, 0);
}
}
int main()
{
cin >> n;
for(int i {}; i < n; ++i)
for(int j {}; j < n; ++j)
cin >> t[j][i];
search(0, 0, 0);
cout << s + 2;
}Test details
Test 1 (public)
Verdict: ACCEPTED
| input |
|---|
| 3 ./\ \./ \/. |
| correct output |
|---|
| 13 |
| user output |
|---|
| 13 |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1 . |
| correct output |
|---|
| 1 |
| user output |
|---|
| 4 |
Feedback: Incorrect character on line 1 col 1: expected "1", got "4"
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 5 ./\/\ ..... ..... ..... ... |
| correct output |
|---|
| 25 |
| user output |
|---|
| 28 |
Feedback: Incorrect character on line 1 col 2: expected "25", got "28"
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 5 \\/\\ /\/\/ \\/\\ /\/\/ ... |
| correct output |
|---|
| 37 |
| user output |
|---|
| 13 |
Feedback: Incorrect character on line 1 col 1: expected "37", got "13"
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| 115 |
Feedback: Incorrect character on line 1 col 1: expected "2519", got "115"
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 89 |
Feedback: Incorrect character on line 1 col 1: expected "917489", got "89"
