#include "vision.h"
#include <bits/stdc++.h>
#define fore(i, b, e) for (int i = b; i < (int)e; ++i)
#define pb push_back
using namespace std;
typedef vector<int> vi;
vector<vi> diagL(410), diagR(410);
vi getRes(int H, int W, int k, vector<vi> &diag) {
vi res, v, pref;
fore(i, 0, H+W-1) {
v.pb(add_or(diag[i]));
pref.pb(add_or(v));
// dos en misma diagonal
int aux = add_xor(diag[i])
aux = add_xor({aux, v.back()});
res.pb(aux);
if (i > 0) {
if (i >= k) {
int tmp = add_xor({pref[i-1], pref[i-k]});
res.pb( add_and({v[i], tmp}) );
}
else {
res.pb( add_and({v[i], pref[i-1]}) );
}
}
}
return res;
}
// dist < k
int solve(int H, int W, int k) {
vi resR, resL;
resL = getRes(H, W, k, diagL);
resR = getRes(H, W, k, diagR);
int rL = add_or(resL);
int rR = add_or(resR);
return add_and({rL, rR});
}
void construct_network(int H, int W, int K) {
fore(i, 0, H) {
fore(j, 0, W) {
diagL[i+j].pb(i*W + j);
diagR[i-j+W-1].pb(i*W + j);
}
}
add_xor({solve(H, W, K), solve(H, W, K+1)});
}
Compilation message
vision.cpp: In function 'vi getRes(int, int, int, std::vector<std::vector<int> >&)':
vision.cpp:20:3: error: expected ',' or ';' before 'aux'
20 | aux = add_xor({aux, v.back()});
| ^~~
vision.cpp:20:32: error: expected primary-expression before ')' token
20 | aux = add_xor({aux, v.back()});
| ^