#include "vision.h"
#include "bits/stdc++.h"
using namespace std;
int nolsemua(vector<int> v){
return add_not(add_or(v));
}
int bersebelahan(vector<int> v){
vector<int> atau;
for(int i=1;i<v.size();i++){
atau.push_back(add_and({v[i-1],v[i]}));
}
return add_or(atau);
}
vector<int> baris(int h,int w){
vector<int> ret;
for(int i=0;i<h;i++){
vector<int> v;
for(int j=0;j<w;j++)v.push_back(i*w+j);
ret.push_back(add_xor(v));
}
return ret;
}
vector<int> kolom(int h,int w){
vector<int> ret;
for(int j=0;j<h;j++){
vector<int> v;
for(int i=0;i<w;i++)v.push_back(i*w+j);
ret.push_back(add_xor(v));
}
return ret;
}
void construct_network(int H, int W, int K) {
int x=add_and({nolsemua(baris(H,W)),bersebelahan(kolom(H,W))});
int y=add_and({nolsemua(kolom(H,W)),bersebelahan(baris(H,W))});
add_or({x,y});
}
Compilation message
vision.cpp: In function 'int bersebelahan(std::vector<int>)':
vision.cpp:11:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1;i<v.size();i++){
~^~~~~~~~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
256 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Incorrect |
4 ms |
256 KB |
on inputs (0, 0), (0, 1), expected 0, but computed 1 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
19 ms |
2032 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Incorrect |
3 ms |
504 KB |
on inputs (96, 18), (96, 19), expected 1, but computed 0 |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |