#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<w;j++){
vector<int> v;
for(int i=0;i<h;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: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Incorrect |
2 ms |
376 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 |
2140 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
4 ms |
508 KB |
Output is correct |
4 |
Correct |
5 ms |
504 KB |
Output is correct |
5 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
6 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
WA in grader: Instruction with no inputs |
2 |
Halted |
0 ms |
0 KB |
- |