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 "vision.h"
#include <vector>
using namespace std;
using a = add_and;
using o = add_or;
using pb = push_back;
int C(int H,int W,int K){
vector<int> M[450];
vector<int> O[450];
for(int i = 0; i < H*W; i++){
M[i/W+int(i%W)].pb(i);
O[i/W-int(i%W)+W-1].pb(i);
}
vector<int> P,Q,R,S,T;
for(int d=0;d<=H+W-2;d++){
P.pb(o(main_list[d]));
Q.pb(o(P));
R.pb(o(opp_list[d]));
S.pb(o(R));
if(d-K >= 0){
T.push_back(a({P[d], Q[d-K]}));
T.push_back(a({R[d], S[d-K]}));
}
}
return o(T);
}
void construct_network(int H, int W, int K){
if(K==H+W-2)C(H, W, K);
else add_xor({C(H, W, K),C(H, W, K+1)});
}
Compilation message (stderr)
vision.cpp:4:11: error: 'add_and' does not name a type
4 | using a = add_and;
| ^~~~~~~
vision.cpp:5:11: error: 'add_or' does not name a type
5 | using o = add_or;
| ^~~~~~
vision.cpp:6:12: error: 'push_back' does not name a type
6 | using pb = push_back;
| ^~~~~~~~~
vision.cpp: In function 'int C(int, int, int)':
vision.cpp:11:25: error: 'class std::vector<int>' has no member named 'pb'
11 | M[i/W+int(i%W)].pb(i);
| ^~
vision.cpp:12:29: error: 'class std::vector<int>' has no member named 'pb'
12 | O[i/W-int(i%W)+W-1].pb(i);
| ^~
vision.cpp:16:11: error: 'class std::vector<int>' has no member named 'pb'
16 | P.pb(o(main_list[d]));
| ^~
vision.cpp:16:16: error: 'main_list' was not declared in this scope; did you mean 'va_list'?
16 | P.pb(o(main_list[d]));
| ^~~~~~~~~
| va_list
vision.cpp:16:14: error: 'o' was not declared in this scope
16 | P.pb(o(main_list[d]));
| ^
vision.cpp:17:11: error: 'class std::vector<int>' has no member named 'pb'
17 | Q.pb(o(P));
| ^~
vision.cpp:18:11: error: 'class std::vector<int>' has no member named 'pb'
18 | R.pb(o(opp_list[d]));
| ^~
vision.cpp:18:16: error: 'opp_list' was not declared in this scope
18 | R.pb(o(opp_list[d]));
| ^~~~~~~~
vision.cpp:19:11: error: 'class std::vector<int>' has no member named 'pb'
19 | S.pb(o(R));
| ^~
vision.cpp:21:25: error: 'a' was not declared in this scope
21 | T.push_back(a({P[d], Q[d-K]}));
| ^
vision.cpp:25:12: error: 'o' was not declared in this scope
25 | return o(T);
| ^