#include <bits/stdc++.h>
using namespace std;
#ifndef WEEE
#include "vision.h"
#else
int add_not(int a) { return 0; }
int add_or (vector<int> a) { return 0; }
int add_and(vector<int> a) { return 0; }
int add_xor(vector<int> a) { return 0; }
#endif
int __w;
inline int I(int i, int j) {
return i * __w + j;
}
void add(int &x, int y) {
// nx = x + 17
int nx = add_xor({x, y});
add_and({x, y});
for(int i = 2; i < 17; i += 2) {
add_xor({nx + i - 1, x + i});
if(i ^ 16) add_and({nx + i - 1, x + i});
}
x = nx;
}
void construct_network(int h, int w, int k) {
__w = w;
///
for(int i = 0; i < h; ++i) {
vector<int> tv;
for(int j = 0; j < w; ++j) {
tv.push_back(I(i, j));
}
add_or(tv);
}
//
for(int j = 0; j < w; ++j) {
vector<int> tv;
for(int i = 0; i < h; ++i) {
tv.push_back(I(i, j));
}
add_or(tv);
}
/////
add_or({h * w});
for(int i = 1; i < h; ++i) {
add_or({(h + 1) * (w + 1) - 1 + i - 1, h * w + i});
}
//
add_or({h * w + h - 1});
for(int i = h - 2; i >= 0; --i) {
add_or({(h + 1) * (w + 1) + h - 1 + (h - 1 - i), h * w + i});
}
/////
add_or({h * (w + 1)});
for(int i = 1; i < w; ++i) {
add_or({h * (w + 1) + i, (h + 1) * (w + 1) + h - 1 + i});
}
//
add_or({h * (w + 1) + w - 1});
for(int i = w - 2; i >= 0; --i) {
add_or({h * (w + 1) + i, (h + 1) * (w + 1) + 2 * h + w - 1 + (w - 1 - i)});
}
/////
for(int i = 0; i < h; ++i) {
add_and({(h + 1) * (w + 1) - 1 + i, (h + 1) * (w + 1) + 2 * h - 2 - i});
}
//
for(int i = 0; i < w; ++i) {
add_and({(h + 1) * (w + 1) + 2 * h - 1 + i, (h + 1) * (w + 1) + 2 * h + 2 * w - 2 - i});
}
/////
int tr = h * w + 4 * h + 4 * w, fl = tr + 1;
assert(add_or({(h + 1) * (w + 1) + h - 2}) == tr);
add_not(tr);
/////
int jl = (h + 1) * (w + 1) + 2 * h + 2 * w - 1, jr = jl + w + h - 1, x = fl + 1;
for(int i = 0; i < 17; ++i) add_or({fl});
for(int i = jl; i <= jr; ++i) add(x, i);
/////
int y = x + 17;
for(int i = 0; i < 9; ++i) {
add_or({(k & (1 << i) ? tr : fl)});
if(i ^ 8) add_or({fl});
}
int z = y + 17;
for(int i = 0; i < 9; ++i) {
add_xor({x + 2 * i, y + 2 * i});
}
for(int i = 0; i < 9; ++i) {
add_not(z + i);
}
z = z + 9;
{
vector<int> tv;
for(int i = 0; i < 9; ++i) {
tv.push_back(z + i);
}
add_and(tv);
}
}
#ifdef WEEE
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
return 0;
}
#endif
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
364 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
372 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
620 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |