| Task: | Hypyt |
| Sender: | rendes |
| Submission time: | 2025-11-09 15:53:04 +0200 |
| Language: | C++ (C++20) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| #4 | WRONG ANSWER | 0 |
| #5 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
| #2 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #3 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #4 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #5 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #6 | ACCEPTED | 0.33 s | 2, 5 | details |
| #7 | ACCEPTED | 0.23 s | 2, 5 | details |
| #8 | ACCEPTED | 0.13 s | 2, 5 | details |
| #9 | WRONG ANSWER | 0.08 s | 3, 4, 5 | details |
| #10 | WRONG ANSWER | 0.08 s | 3, 4, 5 | details |
| #11 | WRONG ANSWER | 0.08 s | 3, 4, 5 | details |
| #12 | WRONG ANSWER | 0.09 s | 4, 5 | details |
| #13 | WRONG ANSWER | 0.09 s | 4, 5 | details |
| #14 | WRONG ANSWER | 0.08 s | 4, 5 | details |
| #15 | WRONG ANSWER | 0.41 s | 5 | details |
| #16 | WRONG ANSWER | 0.31 s | 5 | details |
| #17 | WRONG ANSWER | 0.21 s | 5 | details |
| #18 | WRONG ANSWER | 0.15 s | 5 | details |
| #19 | WRONG ANSWER | 0.09 s | 5 | details |
| #20 | WRONG ANSWER | 0.10 s | 5 | details |
| #21 | ACCEPTED | 0.08 s | 5 | details |
| #22 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #23 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #24 | WRONG ANSWER | 0.08 s | 5 | details |
| #25 | WRONG ANSWER | 0.08 s | 5 | details |
| #26 | WRONG ANSWER | 0.51 s | 5 | details |
| #27 | ACCEPTED | 0.08 s | 5 | details |
Compiler report
input/code.cpp: In function 'int main()':
input/code.cpp:43:14: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
43 | if (tn < h) {
| ~~~^~~
input/code.cpp:45:44: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
45 | for (uin fi = tr._Find_first(); fi < w; fi = tr._Find_next(fi)) {
| ~~~^~~
input/code.cpp:54:44: warning: comparison of integer expressions of different signedness: 'uint' {aka 'unsigned int'} and 'int' [-Wsign-compare]
54 | for (uin fi = tr._Find_first(); fi < h; fi = tr._Find_next(fi)) {
| ~~~^~~Code
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
#define row bitset<250>
#define uin uint
static int h, w, qc;
static std::array<std::bitset<250>, 250> xopt, yopt;
int main() {
std::ios_base::sync_with_stdio(false);
std::cin.tie(NULL);
cin >> h >> w >> qc;
string line;
getline(cin, line);
for (int y = 0; y < h && std::getline(cin, line); y++) {
if (line.size() == 0)
continue;
for (int x = 0; x < w; x++) {
if (line[x] == 46) {
xopt[y][x] = 1;
yopt[x][y] = 1;
}
}
}
array<array<uint, 500>, 500> dist;
for (auto &r : dist)
r.fill(500);
for (int sn = 0; sn < w + h; sn++) {
dist[sn][sn] = 0;
queue<uin> nq;
nq.push(sn);
while (!nq.empty()) {
uin tn = nq.front();
nq.pop();
if (tn < h) {
auto &tr = xopt[tn];
for (uin fi = tr._Find_first(); fi < w; fi = tr._Find_next(fi)) {
uin nn = h + fi;
if (dist[sn][nn] == 500) {
dist[sn][nn] = dist[sn][tn] + 1;
nq.push(nn);
}
}
} else {
auto &tr = yopt[tn - h];
for (uin fi = tr._Find_first(); fi < h; fi = tr._Find_next(fi)) {
if (dist[sn][fi] == 500) {
dist[sn][fi] = dist[sn][tn] + 1;
nq.push(fi);
}
}
}
}
}
int sx, sy, dx, dy;
for (int i = 0; i < qc; i++) {
cin >> sy >> sx >> dy >> dx;
sx--;
sy--;
dx--;
dy--;
if (sx == dx || sy == dy) {
if (sx == sy && dx == dy) {
std::cout << 0 << "\n";
continue;
}
std::cout << 1 << "\n";
continue;
}
int cs = 500;
if (int s = dist[sy][dy]; s < cs)
cs = s;
if (int s = dist[sy][dx+h]; s < cs)
cs=s;
if (int s = dist[sx+h][dx+h]; s < cs)
cs=s;
if (int s = dist[sx+h][dy]; s < cs)
cs=s;
if (cs == 500) {
std::cout << -1 << "\n";
continue;
}
std::cout << cs+1 << "\n";
}
}
Test details
Test 1 (public)
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 4 6 5 .*.*** *...** *****. *..*.* ... |
| correct output |
|---|
| 1 0 3 3 -1 |
| user output |
|---|
| 1 0 3 3 -1 |
Test 2
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 .......... .....*.... ........*. *.*....*.. ... |
| correct output |
|---|
| 1 2 1 2 2 ... |
| user output |
|---|
| 1 2 1 2 2 ... |
Test 3
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 *...***.** *****.*... **..**.**. ..**.**.*. ... |
| correct output |
|---|
| 1 2 2 1 2 ... |
| user output |
|---|
| 1 2 2 1 2 ... |
Test 4
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 ***.*.**** ********** *.******** .*.***.**. ... |
| correct output |
|---|
| 3 4 2 3 4 ... |
| user output |
|---|
| 3 4 2 3 4 ... |
Test 5
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 1 .****.**** **.**..*** ********** *******..* ... |
| correct output |
|---|
| 7 |
| user output |
|---|
| 7 |
Test 6
Group: 2, 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 250 .*...*.....*******..**...*....... |
| correct output |
|---|
| 2 3 3 2 2 ... |
| user output |
|---|
| 2 3 3 2 2 ... |
Test 7
Group: 2, 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 250 ...*......**.**.*.*..**..*..**... |
| correct output |
|---|
| 2 2 2 2 3 ... |
| user output |
|---|
| 2 2 2 2 3 ... |
Test 8
Group: 2, 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 250 **..**..****.****.*.***.***..*... |
| correct output |
|---|
| 2 3 3 3 3 ... |
| user output |
|---|
| 2 3 3 3 3 ... |
Test 9
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 ...*.**.*..*.............*.*..... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| 2 2 2 2 2 ... |
Feedback: Incorrect character on line 818 col 1: expected "0", got "1"
Test 10
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 **.**..*.*.*.******....****.*.... |
| correct output |
|---|
| 2 1 3 2 2 ... |
| user output |
|---|
| 2 1 3 2 2 ... |
Feedback: Incorrect character on line 574 col 1: expected "0", got "1"
Test 11
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 .*.*.**.*****.***.*.****.**.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| 3 3 3 3 3 ... |
Feedback: Incorrect character on line 195 col 1: expected "0", got "1"
Test 12
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 *....**.***..****...*.....*...... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| 2 2 2 2 2 ... |
Feedback: Incorrect character on line 5887 col 1: expected "0", got "1"
Test 13
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 .***.*..*.***..*****....**...*... |
| correct output |
|---|
| 3 2 2 3 2 ... |
| user output |
|---|
| 3 2 2 3 2 ... |
Feedback: Incorrect character on line 5275 col 1: expected "0", got "1"
Test 14
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 *******.*****.*..*..****...***... |
| correct output |
|---|
| 2 3 1 2 2 ... |
| user output |
|---|
| 2 3 1 2 2 ... |
Feedback: Incorrect character on line 3978 col 1: expected "0", got "1"
Test 15
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *....*..*..*..**..*.........**... |
| correct output |
|---|
| 3 2 2 2 2 ... |
| user output |
|---|
| 3 2 2 2 2 ... |
Feedback: Incorrect character on line 18314 col 1: expected "0", got "1"
Test 16
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ..*....*..*......*.**.*.*..***... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| 2 2 2 2 2 ... |
Feedback: Incorrect character on line 17461 col 1: expected "0", got "1"
Test 17
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *..*.*****.*********.****.****... |
| correct output |
|---|
| 3 3 2 2 2 ... |
| user output |
|---|
| 3 3 2 2 2 ... |
Feedback: Incorrect character on line 12904 col 1: expected "0", got "1"
Test 18
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *********.**********.******.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| 3 3 3 3 3 ... |
Feedback: Incorrect character on line 45569 col 1: expected "0", got "1"
Test 19
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 104 422 145 93 65 ... |
| user output |
|---|
| 104 422 145 93 65 ... |
Feedback: Incorrect character on line 294 col 1: expected "0", got "1"
Test 20
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ..****************************... |
| correct output |
|---|
| 57 155 38 65 98 ... |
| user output |
|---|
| 57 155 38 65 98 ... |
Feedback: Incorrect character on line 238 col 1: expected "0", got "1"
Test 21
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 498 498 498 498 498 ... |
| user output |
|---|
| 498 498 498 498 498 ... |
Test 22
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 1 10 * * . * ... |
| correct output |
|---|
| 0 1 1 0 0 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 1 col 1: expected "0", got "1"
Test 23
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 10 10 ........*. 1 7 1 10 1 4 1 7 1 5 1 1 ... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 7 col 1: expected "0", got "1"
Test 24
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 1 200000 * . * . ... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 53 col 1: expected "0", got "1"
Test 25
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 250 200000 *.*.*...*.*.**.***..**.*.*..**... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 283 col 1: expected "0", got "1"
Test 26
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ................................. |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| 2 2 2 2 2 ... |
Feedback: Incorrect character on line 92234 col 1: expected "0", got "1"
Test 27
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 200000 ******************************... |
| correct output |
|---|
| 0 0 0 0 0 ... |
| user output |
|---|
| 0 0 0 0 0 ... |
