#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
const int MAX_N = 405;
int H, W;
vector <int> tl[MAX_N], tr[MAX_N];
vector <int> tL, tR, qsL, qsR;
vector <int> ans;
void init(int h, int w) {
H = h, W = w;
for(int i = 0; i < H + W - 1; i++) {
tl[i].clear();
tr[i].clear();
}
}
int id(int x, int y) {
return x * W + y;
}
int solve(int K) {
ans.clear();
for(int i = 0; i + K < H + W - 1; i++) {
ans.push_back(add_and({qsL[i], tL[i + K]}));
ans.push_back(add_and({qsR[i], tR[i + K]}));
}
return add_or(ans);
}
void construct_network(int h, int w, int K) {
init(h, w);
for(int i = 0; i < H; i++) {
for(int j = 0; j < W; j++) {
tl[i + j].push_back(id(i, j));
tr[H - 1 + j - i].push_back(id(i, j));
}
}
for(int i = 0; i < H + W - 1; i++) {
tL.push_back(add_or(tl[i]));
tR.push_back(add_or(tr[i]));
qsL.push_back(add_or(tL));
qsR.push_back(add_or(tR));
}
if(K == H - W + 2) {
solve(K);
}
else {
add_and({solve(K), add_not(solve(K + 1))});
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
724 KB |
Output is correct |
2 |
Correct |
5 ms |
724 KB |
Output is correct |
3 |
Correct |
4 ms |
660 KB |
Output is correct |
4 |
Incorrect |
1 ms |
512 KB |
WA in grader: Instruction with no inputs |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
3 ms |
596 KB |
Output is correct |
4 |
Correct |
3 ms |
596 KB |
Output is correct |
5 |
Correct |
3 ms |
596 KB |
Output is correct |
6 |
Correct |
2 ms |
596 KB |
Output is correct |
7 |
Incorrect |
1 ms |
468 KB |
WA in grader: Instruction with no inputs |
8 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
26 ms |
3328 KB |
Output is correct |
2 |
Correct |
1 ms |
316 KB |
Output is correct |
3 |
Correct |
5 ms |
596 KB |
Output is correct |
4 |
Correct |
6 ms |
852 KB |
Output is correct |
5 |
Correct |
5 ms |
724 KB |
Output is correct |
6 |
Correct |
5 ms |
852 KB |
Output is correct |
7 |
Correct |
15 ms |
1984 KB |
Output is correct |
8 |
Correct |
14 ms |
2004 KB |
Output is correct |
9 |
Correct |
24 ms |
3344 KB |
Output is correct |
10 |
Correct |
1 ms |
212 KB |
Output is correct |
11 |
Incorrect |
1 ms |
320 KB |
WA in grader: Instruction with no inputs |
12 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |