#include <bits/stdc++.h>
#include "vision.h"
using namespace std;
typedef long long ll;
int solve(int H, int W, int K){
vector<int> X[405], Y[405];
for(int i = 0; i < H; i ++){
for(int j = 0; j < W; j ++){
X[i + j].push_back(i * W + j);
Y[i + W - 1 - j].push_back(i * W + j);
}
}
vector<int> allX, allY, prefX, prefY, result;
for(int i = 0; i <= H + W - 2; i ++){
allX.push_back(add_or(X[i]));
allY.push_back(add_or(Y[i]));
prefX.push_back(add_or(allX));
prefY.push_back(add_or(allY));
if(i >= K){
result.push_back(add_and({allX[i], prefX[i - K]}));
result.push_back(add_and({allY[i], prefY[i - K]}));
}
}
return add_or(result);
}
void construct_network(int H, int W, int K) {
if(H + W - 2 == K)
solve(H, W, K + 1);
else
add_xor({solve(H, W, K), solve(H, W, K + 1)});
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
1100 KB |
Output is correct |
2 |
Correct |
10 ms |
1100 KB |
Output is correct |
3 |
Correct |
13 ms |
1100 KB |
Output is correct |
4 |
Incorrect |
1 ms |
460 KB |
WA in grader: Instruction with no inputs |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
208 KB |
Output is correct |
2 |
Incorrect |
1 ms |
216 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
59 ms |
5780 KB |
Output is correct |
2 |
Correct |
0 ms |
204 KB |
Output is correct |
3 |
Correct |
6 ms |
844 KB |
Output is correct |
4 |
Correct |
11 ms |
1284 KB |
Output is correct |
5 |
Correct |
10 ms |
1188 KB |
Output is correct |
6 |
Correct |
11 ms |
1160 KB |
Output is correct |
7 |
Correct |
36 ms |
3256 KB |
Output is correct |
8 |
Correct |
34 ms |
3224 KB |
Output is correct |
9 |
Correct |
57 ms |
5748 KB |
Output is correct |
10 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
11 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
332 KB |
Output is correct |
2 |
Incorrect |
0 ms |
204 KB |
WA in grader: Instruction with no inputs |
3 |
Halted |
0 ms |
0 KB |
- |