#include<bits/stdc++.h>
#include "vision.h"
#define MAXN 507
using namespace std;
int n,m,k,dist;
vector<int> d[MAXN],e[MAXN];
int res[MAXN],ser[MAXN];
vector<int> bad;
void construct_network(int H, int W, int K){
n=H; m=W; k=K;
for(int i=0;i<n;i++){
for(int f=0;f<m;f++){
d[i-f+m-1].push_back(i*m+f);
e[i+f].push_back(i*m+f);
}
}
for(int i=0;i<n+m-1;i++){
res[i]=add_or(d[i]);
ser[i]=add_or(e[i]);
}
for(int i=0;i<n+m-1;i++){
for(int f=i+k+1;f<n+m-1;f++){
bad.push_back(add_and({res[i],res[f]}));
bad.push_back(add_and({ser[i],ser[f]}));
}
}
for(int i=0;i+k<n+m-1;i++){
good.push_back(add_and({res[i],res[i+k]}));
good.push_back(add_and({ser[i],ser[i+k]}));
}
add_and({add_or(good) , add_not(add_or(bad)) });
}
/*
int main(){
cout<<count_rectangles({{4, 8, 7, 5, 6},
{7, 4, 10, 3, 5},
{9, 7, 20, 14, 2},
{9, 14, 7, 3, 6},
{5, 7, 5, 2, 7},
{4, 5, 13, 5, 6}})<<"\n";
K=3
X . . O . .
. O . . O .
. . O . . X
. . . O . .
return 0;
}
*/
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:34:9: error: 'good' was not declared in this scope
34 | good.push_back(add_and({res[i],res[i+k]}));
| ^~~~
vision.cpp:38:21: error: 'good' was not declared in this scope
38 | add_and({add_or(good) , add_not(add_or(bad)) });
| ^~~~
vision.cpp:38:51: error: could not convert '{<expression error>, add_not(add_or(std::vector<int>(bad)))}' from '<brace-enclosed initializer list>' to 'std::vector<int>'
38 | add_and({add_or(good) , add_not(add_or(bad)) });
| ^
| |
| <brace-enclosed initializer list>