# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
425961 | amoo_safar | Vision Program (IOI19_vision) | C++17 | 21 ms | 1748 KiB |
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"
#define pb push_back
using namespace std;
const int Log = 10;
const int N = 202;
int X[Log];
int r[N], c[N];
void Plus(int var){
for(int i = 0; i < Log; i++){
int tmp = add_and({var, X[i]});
X[i] = add_xor({var, X[i]});
var = tmp;
}
}
void construct_network(int H, int W, int K) {
if(H * W == 2){
int en = add_or({0, 1});
return ;
}
vector<int> Ns;
for(int i = 0; i < Log; i++)
X[i] = add_and({0, 1, 2});
for(int i = 0; i < H; i++){
Ns.clear();
for(int j = 0; j < W; j++){
Ns.pb(i * W + j);
}
r[i] = add_xor(Ns);
}
for(int i = 0; i < W; i++){
Ns.clear();
for(int j = 0; j < H; j++){
Ns.pb(j * W + i);
}
c[i] = add_xor(Ns);
}
for(int i = 1; i < H; i++)
r[i] = add_xor({r[i], r[i - 1]});
for(int i = 1; i < W; i++)
c[i] = add_xor({c[i], c[i - 1]});
for(int i = 0; i < H; i++)
Plus(r[i]);
for(int i = 0; i < W; i++)
Plus(c[i]);
Ns.clear();
for(int i = 0; i < Log; i++){
if(K >> i & 1){
X[i] = add_not(X[i]);
}
Ns.pb(X[i]);
}
add_not(add_or(Ns));
}
Compilation message (stderr)
# | 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... |