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;
void construct_network(int H, int W, int K){
// columns XOR
for(int i = 0; i < W; i++){
vector<int> hi;
for(int j = 0; j < H; j++) hi.push_back(j*W+i);
add_xor(hi);
}
for(int i = 0; i < W-1; i++){
add_and({H*W+i, H*W+i+1});
}
vector<int> hi2;
for(int i = H*W; i<= H*W+W-1; i++) hi2.push_back(i);
add_or(hi2);
hi2.clear();
for(int i = H*W+W; i<= H*W+2*W-2; i++) hi2.push_back(i);
add_or(hi2);
hi2.clear();
int last = H*W+2*W+1;
// lines XOR
for(int i = 0; i < H; i++){
vector<int> hi;
for(int j = 0; j < W; j++) hi.push_back(i*W+j);
add_xor(hi);
}
for(int i = 0; i < H-1; i++){
add_and({last + i, last +i+1});
}
hi2.clear();
for(int i = last; i<= last+H-1; i++) hi2.push_back(i);
add_or(hi2);
hi2.clear();
for(int i = last+H; i<= last+2*H-2; i++) hi2.push_back(i);
add_or(hi2);
hi2.clear();
// last + 2H +1
add_and({H*W+2*W-1, last +2*H});
add_and({last+2*H-1, H*W +2*W});
add_or({last + 2*H +1, last + 2*H +2});
}
# | 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... |