#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define loop(n, i) for (int i = 0; i < n; i++)
#define pb push_back
#define sz(x) (int)(x).size()
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef set<ii> sii;
void construct_network(int H, int W, int K)
{
	if (W == 1)
	{
		vi rowPairs;
		loop(H - 1, i)
		{
			rowPairs.pb(add_and({i, i + 1}));
		}
		add_or(rowPairs);
		return;
	}
	if (H == 1)
	{
		vi colPairs;
		loop(W - 1, i)
		{
			colPairs.pb(add_and({i, i + 1}));
		}
		add_or(colPairs);
		return;
	}
	vi colOrs, rowOrs;
	loop(W, j)
	{
		vi ixs;
		loop(H, i)
		{
			ixs.pb(i * W + j);
		}
		colOrs.pb(add_or(ixs));
	}
	loop(H, i)
	{
		vi ixs;
		loop(W, j)
		{
			ixs.pb(i * W + j);
		}
		rowOrs.pb(add_or(ixs));
	}
	int inzelfdecol = add_xor(colOrs), inzelfderow = add_xor(rowOrs);
	vi colPairs, rowPairs;
	loop(W - 1, j)
	{
		colPairs.pb(add_and({colOrs[j], colOrs[j + 1]}));
	}
	int buurCols = add_or(colPairs);
	loop(H - 1, i)
	{
		rowPairs.pb(add_and({rowOrs[i], rowOrs[i + 1]}));
	}
	int buurRows = add_or(rowPairs);
	int opt1 = add_and({buurRows, inzelfdecol});
	int opt2 = add_and({buurCols, inzelfderow});
	add_or({opt1, opt2});
}
| # | 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... |