#include "vision.h"
using namespace std;
void construct_network(int H, int W, int K) {
int mx = W*H-1;
vector<vector<bool>> visited(H, vector<bool>(W, 0));
int ni = 0;
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
int curr = i*W+j;
for(int a = 0; a < K; a++){
int b = K-a;
int pos1 = (i+a)*W+(j+b);
int pos2 = (i+-a)*W+(j+b);
int pos3 = (i+a)*W+(j+-b);
int pos4 = (i+-a)*W+(j+-b);
if(pos1 >= 0 && pos1 <= mx) add_and(vector<int>{curr, pos1}), ni++;
if(pos2 >= 0 && pos2 <= mx) add_and(vector<int>{curr, pos2}), ni++;
if(pos3 >= 0 && pos3 <= mx) add_and(vector<int>{curr, pos3}), ni++;
if(pos4 >= 0 && pos4 <= mx) add_and(vector<int>{curr, pos4}), ni++;
}
// come trovo le posizioni di distanza K da cord
}
}
vector<int> OR;
for(int i = W*H; i < W*H+ni; i++){
OR.push_back(i);
}
if(OR.size() != 0)
add_or(OR);
else add_not(1);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
288 KB |
Output is correct |
2 |
Incorrect |
1 ms |
340 KB |
on inputs (0, 0), (0, 101), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
976 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Incorrect |
1 ms |
284 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |