| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 152140 | stefdasca | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 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"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
/*
vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);
*/
int fi = H * W;
int lst = H * W - 1;
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j)
add_not(i * W + j), ++lst;
int fi2 = lst + 1;
int lst2 = lst;
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j)
{
vector<int>vec;
for(int q = 0; q < H; ++q)
for(int z = 0; z < W; ++z)
if(abs(i - q) + abs(j - z) == K)
vec.pb(q * W + z);
add_and({add_and(i * W + j), add_and(vec)});
++lst2;
}
vector<int>s;
for(int i = fi2; i <= lst2; ++i)
s.push_back(i);
add_or(s);
}
