# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
429173 | albertolg101 | Vision Program (IOI19_vision) | C++17 | 20 ms | 1680 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 <bits/stdc++.h>
#include "vision.h"
using namespace std;
vector<int> g (int a, int b)
{
return vector<int> {a, b};
}
void construct_network(int H, int W, int K) {
vector<int> ar;
{
int last = 0;
for(int i = 0 ; i < H - 1 ; i++)
{
vector<int> q;
for(int j = 0 ; j < W ; j++)
{
q.push_back(i * W + j);
}
if(last != 0)
q.push_back(last);
last = add_xor(q);
ar.push_back(last);
}
last = 0;
for(int j = 0 ; j < W ; j++)
{
vector<int> q;
for(int i = 0 ; i < H ; i++)
{
q.push_back(i * W + j);
}
if(last != 0)
q.push_back(last);
last = add_xor(q);
ar.push_back(last);
}
}
int zero = ar.back(),
one = add_not(zero);
vector<int> c;
for(int i = 0 ; i < 9 ; i++)
c.push_back(add_and(g(zero, one)));
for(int i = 0 ; i < ar.size() ; i++)
{
vector<int> new_c;
int rest = ar[i];
for(int j = 0 ; j < c.size() ; j++)
{
new_c.push_back(add_xor(g(c[j], rest)));
rest = add_and(g(c[j], rest));
}
c = new_c;
}
vector<int> d, k;
for(int i = 0 ; i < 9 ; i++)
{
if((1<<i) & K)
{
k.push_back(add_and(g(one, one)));
}
else
{
k.push_back(add_and(g(zero, zero)));
}
}
for(int i = 0 ; i < 9 ; i++)
{
d.push_back(add_xor(g(c[i], k[i])));
}
add_not(add_or(d));
return ;
}
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... |