#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
int xr[201],xc[201],r[201],c[201],od[401],od2[401];
vector <int> v,vr,vc,vd;
void construct_network(int H, int W, int K){
for (int i=0;i<H;i++){
v.clear();
for (int j=0;j<W;j++)
v.push_back(i*W+j);
xr[i]=add_xor(v);
r[i]=add_or(v);
v.clear();
for (int j=max(0,i-K+1);j<=i;j++)
v.push_back(xr[j]);
int X=add_not(add_xor(v));
v.clear();
for (int j=max(i-K+1,0);j<=i;j++)
v.push_back(r[j]);
vr.push_back(add_and({X,add_or(v)}));
}
for (int i=0;i<W;i++){
v.clear();
for (int j=0;j<H;j++)
v.push_back(j*W+i);
xc[i]=add_xor(v);
c[i]=add_or(v);
v.clear();
for (int j=max(i-K+1,0);j<=i;j++)
v.push_back(xc[j]);
int X=add_not(add_xor(v));
v.clear();
for (int j=max(i-K+1,0);j<=i;j++)
v.push_back(c[j]);
int Y=add_or(v);
vc.push_back(add_and({X,Y}));
}
for (int i=0;i<H+W-1;i++){
v.clear();
for (int j=max(i-W+1,0);j<=min(i,H-1);j++)
v.push_back(j*(W-1)+i);
od[i]=add_or(v);
v.clear();
for (int j=max(0,H-i-1);j<min(H,H+W-i-1);j++)
v.push_back(j*(W+1)+i-H+1);
od2[i]=add_or(v);
if (i>=K){
vd.push_back(add_and({od[i],od[i-K]}));
vd.push_back(add_and({od2[i],od2[i-K]}));
}
}
add_and({add_and({add_or(vr),add_or(vc)}),add_or(vd)});
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
600 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
20 ms |
2904 KB |
on inputs (80, 199), (81, 199), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
on inputs (0, 0), (0, 1), expected 1, but computed 0 |
2 |
Halted |
0 ms |
0 KB |
- |