#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
void construct_network(int h, int w, int k)
{
vector<int> rd1(w + h - 1);
vector<int> rd2(w + h - 1);
vector<int> ld1(w + h - 1);
vector<int> ld2(w + h - 1);
for (int d = 0; d < w + h - 1; d++)
{
vector<int> idxR, idxL;
// i + j = d
for (int i = 0, j = d; i < h && j >= 0; i++, j--)
if (j < w) idxR.push_back(i * w + j);
// i + (w - 1 - j) = d
for (int i = 0, j = w - d - 1; i < h && j < w; i++, j++)
if (j >= 0) idxL.push_back(i * w + j);
rd1[d] = add_xor(idxR);
rd2[d] = add_and({add_or(idxR), add_not(rd1[d])});
ld1[d] = add_xor(idxL);
ld2[d] = add_and({add_or(idxL), add_not(ld1[d])});
}
vector<int> A, B;
for (int d = 0; d + k < w + h - 1; d++)
{
vector<int> idxR1, idxR2, idxL1, idxL2;
for (int i = d; i <= d + k; i++)
{
idxR1.push_back(rd1[d]);
idxR2.push_back(rd2[d]);
idxL1.push_back(ld1[d]);
idxL2.push_back(ld2[d]);
}
A.push_back(add_or({add_or(idxR2), add_and({add_or(idxR1), add_not(add_xor(idxR1))})}));
B.push_back(add_or({add_or(idxL2), add_and({add_or(idxL1), add_not(add_xor(idxL1))})}));
}
vector<int> C, D;
for (int d = 0; d + k - 1 < w + h - 1; d++)
{
vector<int> idxR1, idxR2, idxL1, idxL2;
for (int i = d; i <= d + k - 1; i++)
{
idxR1.push_back(rd1[d]);
idxR2.push_back(rd2[d]);
idxL1.push_back(ld1[d]);
idxL2.push_back(ld2[d]);
}
C.push_back(add_or({add_or(idxR2), add_and({add_or(idxR1), add_not(add_xor(idxR1))})}));
D.push_back(add_or({add_or(idxL2), add_and({add_or(idxL1), add_not(add_xor(idxL1))})}));
}
int x = add_and({add_or(A), add_or(B)});
int y = add_and({add_or(A), add_or(B)});
add_and({x, add_not(y)});
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
720 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1616 KB |
WA in grader: Too many instructions |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |