#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
/*
vector<int> Ns;
Ns = {0, 1};
int a = add_and(Ns);
Ns = {0, a};
int b = add_or(Ns);
Ns = {0, 1, b};
int c = add_xor(Ns);
add_not(c);
*/
int Line1 = -1, Line2 = -1;
int Column1 = -1, Column2 = -1;
int index[302][302];
memset(index, 0, sizeof(index));
int pa = 0;
for(int i = 0; i < H; ++i)
{
vector<int>v;
for(int j = 0; j < W; ++j)
v.push_back(pa), index[i][j] = pa, ++pa;
int ans = add_or(v);
if(ans == 1)
{
if(Line1 != -1)
Line2 = i;
else
Line1 = i;
}
}
if(Line2 == -1)
Line2 = Line1;
int rr = 0;
for(int i = 0; i < W; ++i)
{
int ans = add_not(index[Line1][i]);
if(ans == 0)
{
if(Column1 == -1)
Column1 = i;
else
Column2 = i;
}
else
rr = index[Line1][i];
}
if(Column2 == -1)
for(int i = 0; i < W; ++i)
{
int ans = add_not(index[Line2][i]);
if(ans == 0)
Column2 = i;
}
int md = abs(Line1 - Line2) + abs(Column1 - Column2);
if(md == K)
add_and({index[Line1][Column1], index[Line2][Column2]});
else
add_and({rr});
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
632 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
632 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
632 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
632 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
760 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
504 KB |
on inputs (0, 0), (1, 1), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
888 KB |
WA in grader: Invalid index |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
632 KB |
on inputs (0, 0), (0, 2), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |