# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
778420 | Elias | Vision Program (IOI19_vision) | C++17 | 17 ms | 2428 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.
#ifndef _DEBUG
#include "vision.h"
#endif
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
int nott = add_not(0);
int def_zero = add_and({0, nott});
vector<int> xor_single;
for (int i = 0; i < H; i++)
{
vector<int> indices;
for (int j = 0; j < W; j++)
{
indices.push_back(i * W + j);
}
xor_single.push_back(add_xor(indices));
}
for (int j = 0; j < W; j++)
{
vector<int> indices;
for (int i = 0; i < H; i++)
{
indices.push_back(i * W + j);
}
xor_single.push_back(add_xor(indices));
}
assert(xor_single.size() == W + H);
vector<int> xor_prefix;
vector<int> indices;
for (int i = 0; i < W + H; i++)
{
indices.push_back(xor_single[i]);
xor_prefix.push_back(add_xor(indices));
}
assert(xor_prefix.size() == W + H);
vector<int> bits;
for (int k = 0; k <= 8; k++)
{
int carry = def_zero;
if (K & (1 << k))
bits.push_back(add_xor(xor_prefix));
else
bits.push_back(add_not(add_xor(xor_prefix)));
vector<int> new_xor_prefix;
for (int i = 0; i < W + H; i++)
{
new_xor_prefix.push_back(add_and({carry, xor_prefix[i]}));
carry = add_xor({carry, xor_prefix[i]});
}
xor_prefix = new_xor_prefix;
}
cout << "bits: ";
for (int i = 0; i < bits.size(); i++)
cout << bits[i] << " ";
cout << "\n";
add_and(bits);
}
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... |