| Task: | Robotti |
| Sender: | Wiita |
| Submission time: | 2026-01-17 13:25:42 +0200 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | TIME LIMIT EXCEEDED | 0 |
| test | verdict | time | |
|---|---|---|---|
| #1 | TIME LIMIT EXCEEDED | -- | details |
| #2 | WRONG ANSWER | 0.00 s | details |
| #3 | TIME LIMIT EXCEEDED | -- | details |
| #4 | TIME LIMIT EXCEEDED | -- | details |
| #5 | TIME LIMIT EXCEEDED | -- | details |
| #6 | WRONG ANSWER | 0.00 s | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:42:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
42 | if (dy = 1) {dy = 0; dx = 1;}
| ~~~^~~
input/code.cpp:43:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
43 | else if (dy = -1) {dy = 0; dx = -1;}
| ~~~^~~~
input/code.cpp:44:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
44 | else if (dx = 1) {dy = -1; dx = 0;}
| ~~~^~~
input/code.cpp:45:25: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
45 | else if (dx = -1) {dy = 1; dx = 0;}
| ~~~^~~~
input/code.cpp:51:20: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
51 | if (dy = 1) {dy = 0; dx = -1;}
|...Code
#include <iostream>
#include <bits/stdc++.h>
#include <algorithm>
#include <vector>
using namespace std;
long long n;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
cin >> n;
cout << n;
vector<string> grid(n);
for (int i = 0; i < n; i++)
{
cin >> grid[i];
}
long long x = 0, y = -1;
long long dx = 0, dy = 1;
int steps = 0;
while (true)
{
x += dx;
y += dy;
steps++;
if (x < 0 || x >= n || y < 0 || y >= n) break;
if (grid[y][x] == '\\')
{
if (dy = 1) {dy = 0; dx = 1;}
else if (dy = -1) {dy = 0; dx = -1;}
else if (dx = 1) {dy = -1; dx = 0;}
else if (dx = -1) {dy = 1; dx = 0;}
}
if (grid[y][x] == '/')
{
if (dy = 1) {dy = 0; dx = -1;}
else if (dy = -1) {dy = 0; dx = 1;}
else if (dx = 1) {dy = 1; dx = 0;}
else if (dx = -1) {dy = -1; dx = 0;}
}
}
cout << steps;
return 0;
}Test details
Test 1 (public)
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 3 ./\ \./ \/. |
| correct output |
|---|
| 13 |
| user output |
|---|
| (empty) |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 1 . |
| correct output |
|---|
| 1 |
| user output |
|---|
| 12 |
Feedback: Incorrect character on line 1 col 2: expected "1", got "12"
Test 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 5 ./\/\ ..... ..... ..... ... |
| correct output |
|---|
| 25 |
| user output |
|---|
| (empty) |
Test 4
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 5 \\/\\ /\/\/ \\/\\ /\/\/ ... |
| correct output |
|---|
| 37 |
| user output |
|---|
| (empty) |
Test 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 20 \\/\/\/\\./\\.\/\/\. /\\\\\\/\\\\\\\\\\\. \\\\\\\\\\\\\\\\\\\\ /\\\\\\\\\\\\\.\\\\\ ... |
| correct output |
|---|
| 2519 |
| user output |
|---|
| (empty) |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 20 \\.................. .\\..............\\. ..\\............\\.. ...\\..........\\... ... |
| correct output |
|---|
| 917489 |
| user output |
|---|
| 2021 |
Feedback: Incorrect character on line 1 col 1: expected "917489", got "2021"
