#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
bool c(int i,int j,int n,int m){
if(i<0||j<0||i>=n||j>=m) return false;
return true;
}
void construct_network(int H, int W, int K) {
vector<int> indexes;
set<vector<int>> s;
int n = H, m = W, k = K;
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
int cr = i*W + j;
vector<int> vec;
vec.push_back(cr);
vec.push_back(cr);
for(int r=0;r<=k;r++){
int rem = k-r;
if(c(i+r,j+rem,n,m)){
int nin = (i+r)*W + (j+rem);
//int in = add_and({nin,cr});
vec.push_back(nin);
}
if(c(i-r,j+rem,n,m)){
int nin = (i-r)*W + (j+rem);
//int in = add_and({nin,cr});
vec.push_back(nin);
}
if(c(i+r,j-rem,n,m)){
int nin = (i+r)*W + (j-rem);
//int in = add_and({nin,cr});
vec.push_back(nin);
}
if(c(i-r,j-rem,n,m)){
int nin = (i-r)*W + (j-rem);
//int in = add_and({nin,cr});
vec.push_back(nin);
}
}
s.insert(vec);
}
}
for(auto z:s){
int i = add_and(z);
indexes.push_back(i);
}
int f = add_or(indexes);
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:52:6: warning: unused variable 'f' [-Wunused-variable]
52 | int f = add_or(indexes);
| ^
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
on inputs (0, 1), (0, 2), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
14 ms |
5676 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |