#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,ve,ve2;
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]);
ve.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[i]);
int X=add_not(add_xor(v));
v.clear();
for (int j=max(i-K+1,0);j<=i;j++)
v.push_back(c[i]);
ve.push_back(add_and({X,add_or(v)}));
}
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){
ve2.push_back(add_and({od[i],od[i-K]}));
ve2.push_back(add_and({od2[i],od2[i-K]}));
}
}
add_and({add_or(ve),add_or(ve2)});
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
444 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
444 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Incorrect |
0 ms |
500 KB |
on inputs (0, 3), (1, 0), expected 0, but computed 1 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
444 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Incorrect |
0 ms |
500 KB |
on inputs (0, 3), (1, 0), expected 0, but computed 1 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
444 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Incorrect |
0 ms |
500 KB |
on inputs (0, 3), (1, 0), expected 0, but computed 1 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
600 KB |
Output is correct |
2 |
Correct |
3 ms |
604 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
4 ms |
696 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
604 KB |
Output is correct |
7 |
Correct |
4 ms |
860 KB |
Output is correct |
8 |
Correct |
4 ms |
860 KB |
Output is correct |
9 |
Correct |
1 ms |
604 KB |
Output is correct |
10 |
Correct |
3 ms |
704 KB |
Output is correct |
11 |
Correct |
4 ms |
604 KB |
Output is correct |
12 |
Correct |
3 ms |
832 KB |
Output is correct |
13 |
Correct |
4 ms |
860 KB |
Output is correct |
14 |
Correct |
7 ms |
860 KB |
Output is correct |
15 |
Correct |
1 ms |
600 KB |
Output is correct |
16 |
Correct |
3 ms |
604 KB |
Output is correct |
17 |
Correct |
3 ms |
604 KB |
Output is correct |
18 |
Correct |
5 ms |
604 KB |
Output is correct |
19 |
Correct |
5 ms |
788 KB |
Output is correct |
20 |
Correct |
4 ms |
860 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
3 ms |
856 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
3 ms |
604 KB |
Output is correct |
7 |
Correct |
3 ms |
688 KB |
Output is correct |
8 |
Correct |
5 ms |
860 KB |
Output is correct |
9 |
Correct |
7 ms |
860 KB |
Output is correct |
10 |
Correct |
5 ms |
856 KB |
Output is correct |
11 |
Correct |
5 ms |
824 KB |
Output is correct |
12 |
Correct |
5 ms |
860 KB |
Output is correct |
13 |
Correct |
1 ms |
604 KB |
Output is correct |
14 |
Correct |
4 ms |
600 KB |
Output is correct |
15 |
Correct |
4 ms |
860 KB |
Output is correct |
16 |
Correct |
4 ms |
956 KB |
Output is correct |
17 |
Correct |
1 ms |
604 KB |
Output is correct |
18 |
Correct |
5 ms |
700 KB |
Output is correct |
19 |
Correct |
4 ms |
868 KB |
Output is correct |
20 |
Correct |
11 ms |
1640 KB |
Output is correct |
21 |
Incorrect |
14 ms |
2152 KB |
on inputs (0, 0), (199, 99), expected 0, but computed 1 |
22 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
22 ms |
2920 KB |
Output is correct |
2 |
Correct |
1 ms |
616 KB |
Output is correct |
3 |
Correct |
2 ms |
616 KB |
Output is correct |
4 |
Correct |
4 ms |
872 KB |
Output is correct |
5 |
Correct |
1 ms |
616 KB |
Output is correct |
6 |
Correct |
1 ms |
616 KB |
Output is correct |
7 |
Correct |
11 ms |
1628 KB |
Output is correct |
8 |
Correct |
14 ms |
1768 KB |
Output is correct |
9 |
Correct |
21 ms |
2908 KB |
Output is correct |
10 |
Correct |
1 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
440 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
1 ms |
348 KB |
Output is correct |
5 |
Correct |
1 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
0 ms |
348 KB |
Output is correct |
8 |
Correct |
1 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
444 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
12 |
Correct |
1 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
600 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
0 ms |
348 KB |
Output is correct |
18 |
Correct |
0 ms |
348 KB |
Output is correct |
19 |
Correct |
1 ms |
348 KB |
Output is correct |
20 |
Correct |
0 ms |
348 KB |
Output is correct |
21 |
Incorrect |
0 ms |
500 KB |
on inputs (0, 3), (1, 0), expected 0, but computed 1 |
22 |
Halted |
0 ms |
0 KB |
- |