| Task: | Ratsun reitit |
| Sender: | intoo |
| Submission time: | 2020-09-28 00:38:41 +0300 |
| Language: | C++ (C++17) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #2 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #3 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #4 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #5 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #6 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #7 | WRONG ANSWER | 0.01 s | 1, 2, 3 | details |
| #8 | WRONG ANSWER | 0.22 s | 2, 3 | details |
| #9 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
| #10 | TIME LIMIT EXCEEDED | -- | 2, 3 | details |
| #11 | TIME LIMIT EXCEEDED | -- | 3 | details |
| #12 | TIME LIMIT EXCEEDED | -- | 3 | details |
| #13 | TIME LIMIT EXCEEDED | -- | 3 | details |
Code
#include <iostream>
#include <queue>
using namespace std;
int t[101][101];
int e[101][101];
int o[101][101];
int main() {
int n;
queue<pair<int,int>> q;
cin >> n;
q.push({0, 0});
e[0][0] = -1;
while (!q.empty()) {
auto p = q.front();
q.pop();
int y = p.first;
int x = p.second;
t[y][x] = e[y][x]+1;
o[y][x] = 1;
for (int i = -2; i <= 2; i++) {
if (!i) continue;
if (y+i >= 0 && y+i < n) {
if (x+2/i >= 0 && x+2/i < n) {
if (o[y+i][x+2/i]) continue;
q.push({y+i, x+2/i});
e[y+i][x+2/i] = t[y][x];
}
if (x-2/i >= 0 && x-2/i < n) {
if (o[y+i][x-2/i]) continue;
q.push({y+i, x-2/i});
e[y+i][x-2/i] = t[y][x];
}
}
}
}
for (int y = 0; y < n; y++) {
for (int x = 0; x < n; x++) {
cout << t[y][x] << ' ';
}
cout << "\n";
}
}
Test details
Test 1
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 4 |
| correct output |
|---|
| 0 3 2 5 3 4 1 2 2 1 4 3 5 2 3 2 |
| user output |
|---|
| 0 3 4 5 3 4 1 2 2 1 4 3 5 2 3 2 |
Test 2
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 5 |
| correct output |
|---|
| 0 3 2 3 2 3 4 1 2 3 2 1 4 3 2 3 2 3 2 3 2 3 2 3 4 |
| user output |
|---|
| 0 3 4 3 4 3 4 1 2 5 2 1 4 3 2 3 2 3 2 3 2 3 2 3 4 |
Test 3
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 6 |
| correct output |
|---|
| 0 3 2 3 2 3 3 4 1 2 3 4 2 1 4 3 2 3 3 2 3 2 3 4 2 3 2 3 4 3 ... |
| user output |
|---|
| 0 3 4 3 4 3 3 4 1 2 5 4 2 1 4 3 2 3 3 2 3 2 3 4 2 3 2 3 4 3 ... |
Test 4
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 7 |
| correct output |
|---|
| 0 3 2 3 2 3 4 3 4 1 2 3 4 3 2 1 4 3 2 3 4 3 2 3 2 3 4 3 2 3 2 3 4 3 4 ... |
| user output |
|---|
| 0 3 4 3 4 3 4 3 4 1 2 5 4 5 2 1 4 3 2 3 4 3 2 3 2 3 4 3 2 3 2 3 4 3 4 ... Truncated |
Test 5
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 8 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 3 4 1 2 3 4 3 4 2 1 4 3 2 3 4 5 3 2 3 2 3 4 3 4 2 3 2 3 4 3 4 5 ... |
| user output |
|---|
| 0 3 4 3 4 3 4 0 3 4 1 2 5 4 5 4 2 1 4 3 2 3 4 5 3 2 3 2 3 4 3 4 2 3 2 3 4 3 4 5 ... Truncated |
Test 6
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 9 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 3 4 1 2 3 4 3 4 5 2 1 4 3 2 3 4 5 4 3 2 3 2 3 4 3 4 5 2 3 2 3 4 3 4 5 4 ... |
| user output |
|---|
| 0 3 4 3 4 3 4 7 0 3 4 1 2 5 4 5 4 5 2 1 4 3 2 3 4 5 6 3 2 3 2 3 4 3 4 5 2 3 2 3 4 3 4 ... Truncated |
Test 7
Group: 1, 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 10 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 3 4 1 2 3 4 3 4 5 6 2 1 4 3 2 3 4 5 4 5 3 2 3 2 3 4 3 4 5 6 2 3 2 3 4 3 4 5 4 5 ... |
| user output |
|---|
| 0 3 4 3 4 3 4 7 6 7 3 4 1 2 5 4 5 4 5 8 2 1 4 3 2 3 4 5 6 5 3 2 3 2 3 4 3 4 5 6 2 3 2 ... Truncated |
Test 8
Group: 2, 3
Verdict: WRONG ANSWER
| input |
|---|
| 25 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| 0 3 4 3 4 3 4 7 6 7 6 7 10 9 1... Truncated |
Test 9
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 49 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 10
Group: 2, 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 50 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 11
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 75 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 12
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 99 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
Test 13
Group: 3
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 100 |
| correct output |
|---|
| 0 3 2 3 2 3 4 5 4 5 6 7 6 7 8 ... |
| user output |
|---|
| (empty) |
