#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
const int nx=205;
int R[nx], C[nx], cr, l, vl, F, T, zero;
int add_num(int x, int c)
{
for (int i=0; i<9; i++)
{
add_xor(vector<int> {x+2*i, c});
c=add_and(vector<int> {x+2*i, c});
}
return c-17;
}
void construct_network(int H, int W, int K) {
add_not(H*W-1);
F=add_and(vector<int> {H*W-1, H*W});
T=add_or(vector<int> {H*W-1, H*W});
for (int i=0; i<18; i++) add_not(T);
vl=H*W+3;
for (int i=0; i<H; i++)
{
vector<int> v;
for (int j=0; j<W; j++) v.push_back(W*i+j);
R[i]=add_xor(v);
}
for (int i=0; i<W; i++)
{
vector<int> v;
for (int j=0; j<H; j++) v.push_back(i+H*j);
C[i]=add_xor(v);
}
cr=F;
for (int i=0; i<H; i++)
{
cr=add_xor(vector<int> {cr, R[i]});
//cout<<"cr "<<cr<<'\n';
vl=add_num(vl, cr);
}
for (int i=0; i<W; i++)
{
cr=add_xor(vector<int> {cr, C[i]});
//cout<<"here "<<i<<' '<<vl<<'\n';
vl=add_num(vl, cr);
//cout<<"loc "<<i<<' '<<vl<<'\n';
}
vector<int> v;
for (int i=0; i<9; i++) v.push_back(add_not(add_xor(vector<int> {(K&(1<<i))?T:F, vl+i})));
add_and(v);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 2), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 2), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 2), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 2), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
600 KB |
on inputs (0, 0), (0, 33), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Incorrect |
1 ms |
504 KB |
on inputs (0, 0), (1, 1), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
12 ms |
1840 KB |
on inputs (4, 92), (37, 124), expected 0, but computed 1 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Incorrect |
0 ms |
348 KB |
on inputs (0, 0), (0, 2), expected 1, but computed 0 |
3 |
Halted |
0 ms |
0 KB |
- |