//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
#define ve vector
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9 + 10;
void construct_network(int H, int W, int K) {
ve<int> X;
set<pii> S;
for (int i = 0; i < H; i++) {
for (int j = 0; j < W; j++) {
int index = i * W + j;
for (int k = -K; k <= K; k++) {
int iNew = i + k;
int jNew = j + (K - abs(k));
int indexNew = iNew * W + jNew;
if (0 <= iNew && iNew < H && 0 <= jNew && jNew < W) {
if (index > indexNew) swap(index, indexNew);
S.insert({index, indexNew});
}
iNew = i + k;
jNew = j - (K - abs(k));
indexNew = iNew * W + jNew;
if (0 <= iNew && iNew < H && 0 <= jNew && jNew < W) {
if (index > indexNew) swap(index, indexNew);
S.insert({index, indexNew});
}
}
}
}
for (pii s : S) {
int x = add_and({s.first, s.second});
X.push_back(x);
}
add_or(X);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
204 KB |
Output is correct |
5 |
Incorrect |
1 ms |
332 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
42 ms |
10416 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Incorrect |
1 ms |
204 KB |
on inputs (0, 0), (2, 0), expected 0, but computed 1 |
4 |
Halted |
0 ms |
0 KB |
- |