#include "vision.h"
#include <bits/stdc++.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);
map<int, bool> tested;
if(pos1 >= 0 && pos1 <= mx && !tested[pos1]) add_and(vector<int>{curr, pos1}), tested[pos1] = true, ni++;
if(pos2 >= 0 && pos2 <= mx && !tested[pos2]) add_and(vector<int>{curr, pos2}), tested[pos2] = true, ni++;
if(pos3 >= 0 && pos3 <= mx && !tested[pos3]) add_and(vector<int>{curr, pos3}), tested[pos3] = true, ni++;
if(pos4 >= 0 && pos4 <= mx && !tested[pos4]) add_and(vector<int>{curr, pos4}), tested[pos4] = true, 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);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 101), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
976 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
0 ms |
212 KB |
Output is correct |
4 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (1, 0), expected 0, but computed 1 |
5 |
Halted |
0 ms |
0 KB |
- |