#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5;
int a[N];
void MakeItGood(int h, int w) {
for(int i = 0; i < h * w - 1; i++) {
a[i] = 0;
}
}
/*int add_and(vector<int> x) {
int ans = 1;
for(int i = 0; i < x.size(); i++) {
ans &= a[x[i]];
}
return ans;
}
int add_or(vector<int> x) {
int ans = 0;
for(int i = 0; i < x.size(); i++) {
ans |= a[x[i]];
}
return ans;
}*/
void construct_network(int H, int W, int K) {
vector<int> x;
for(int i = 0; i < H; i++) {
for(int j = 0; j < W; j++) {
for(int y = 0; y < K; y++) {
int newx = i + y, newy = j + K - y;
if(i + y < H) {
if(j + K - y < W) {
x.push_back(add_and({i * W + j, (i + y) * W + j + K - y}));
}
if(j - K + y >= 0) {
x.push_back(add_and({i * W + j, (i + y) * W + j - K + y}));
}
}
if(i - y >= 0) {
if(j + K - y < W) {
x.push_back(add_and({i * W + j, (i - y) * W + j + K - y}));
}
if(j - K + y >= 0) {
x.push_back(add_and({i * W + j, (i - y) * W + j - K + y}));
}
}
}
}
}
add_or(x);
/*std::vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);*/
}
/*int main() {
int h, w, k;
cin >> h >> w >> k;
while(true) {
int r1;
cin >> r1;
if(r1 == -1)
break;
int c1, r2, c2;
cin >> c1 >> r2 >> c2;
MakeItGood(h, w);
a[r1 * w + c1] = 1;
a[r2 * w + c2] = 1;
construct_network(h, w, k);
}
}*/
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:34:21: warning: unused variable 'newx' [-Wunused-variable]
34 | int newx = i + y, newy = j + K - y;
| ^~~~
vision.cpp:34:35: warning: unused variable 'newy' [-Wunused-variable]
34 | int newx = i + y, newy = j + K - y;
| ^~~~
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
0 ms |
364 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
0 ms |
364 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
0 ms |
364 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
0 ms |
364 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Incorrect |
1 ms |
364 KB |
WA in grader: Instruction with no inputs |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
on inputs (0, 0), (1, 0), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
1128 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
364 KB |
Output is correct |
3 |
Incorrect |
0 ms |
364 KB |
WA in grader: Instruction with no inputs |
4 |
Halted |
0 ms |
0 KB |
- |