This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 (stderr)
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 |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |