# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
293404 | Dovran | 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 <bits/stdc++.h>
#define N 100009
#define pii pair <int, int>
#define ff first
#define ss second
#define sz size
#define pb push_back
#define ll long long
using namespace std;
void construct_network(int n, int m, int k){
if(k!=1)
{
vector<int>e;
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
if(i+j==k)
e.pb(i*m+j);
}
}
add_or(e);
return;
}
vector<int>a, b, c, d;
for(int i=0; i<n; i++){
vector<int>e;
for(int j=0; j<m; j++)
e.pb(i*m+j);
a.pb(add_or(e));
}
for(int j=0; j<m; j++){
vector<int>e;
for(int i=0; i<n; i++)
e.pb(i*m+j);
c.pb(add_or(e));
}
for(int i=0; i<a.sz()-1; i++)
b.pb(add_and({a[i], a[i+1]}));
for(int i=0; i<c.sz()-1; i++)
b.pb(add_and({c[i], c[i+1]}));
for(auto i:c)
a.pb(i);
int x=add_xor(a);
int y=add_xor(b);
add_and({x, y});
}