#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 Line1 = -1, Line2 = -1;
int Column1 = -1, Column2 = -1;
for(int i = 0; i < H; ++i)
{
vector<int>v;
for(int j = 0; j < W; ++j)
v.pb(i * W + j);
int ans = add_or(v);
if(ans == 1)
{
if(Line1 != -1)
Line2 = i;
else
Line1 = i;
}
}
if(Line2 == -1)
Line2 = Line1;
for(int i = 0; i < W; ++i)
{
int ans = add_not(Line1 * W + i);
if(ans == 0)
{
if(Column1 == -1)
Column1 = i;
else
Column2 = i;
}
}
if(Column2 == -1)
for(int i = 0; i < W; ++i)
{
int ans = add_not(Line2 * W + i);
if(ans == 0)
Column2 = i;
}
add_and({Line1 * W + Column1, Line2 * W + Column2});
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:23:15: error: 'class std::vector<int>' has no member named 'pb'
v.pb(i * W + j);
^~