#include "vision.h"
#include<bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K)
{
bool sk[302][302];
int qu1[302][302], qu2[302][302];
memset(sk, 0, sizeof(sk));
memset(qu1, 0, sizeof(qu1));
memset(qu2, 0, sizeof(qu2));
int query_number = H * W;
int z = 0;
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j)
{
vector<int>pz;
for(int p = 0; p <= i; ++p)
for(int z = 0; z < W; ++z)
if(abs(i - p) + abs(j - z) == K)
pz.push_back({p * W + z});
if(!pz.size() || z >= 3333)
sk[i][j] = 1;
else
++z, qu1[i][j] = query_number, add_or(pz), ++query_number;
}
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j)
{
if(sk[i][j])
continue;
add_and({i * W + j});
qu2[i][j] = query_number;
++query_number;
}
vector<int>p;
for(int i = 0; i < H; ++i)
for(int j = 0; j < W; ++j)
if(!sk[i][j])
p.push_back(query_number), add_and({qu1[i][j], qu2[i][j]}), ++query_number;
add_or(p);
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
3 ms |
1144 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1144 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1144 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
3 ms |
1144 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1144 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1144 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
19 |
Correct |
3 ms |
1144 KB |
Output is correct |
20 |
Correct |
3 ms |
1116 KB |
Output is correct |
21 |
Correct |
3 ms |
1144 KB |
Output is correct |
22 |
Correct |
3 ms |
1144 KB |
Output is correct |
23 |
Correct |
3 ms |
1144 KB |
Output is correct |
24 |
Correct |
3 ms |
1144 KB |
Output is correct |
25 |
Correct |
3 ms |
1148 KB |
Output is correct |
26 |
Correct |
3 ms |
1144 KB |
Output is correct |
27 |
Correct |
3 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
3 ms |
1144 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1144 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1144 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
19 |
Correct |
3 ms |
1144 KB |
Output is correct |
20 |
Correct |
3 ms |
1116 KB |
Output is correct |
21 |
Correct |
3 ms |
1144 KB |
Output is correct |
22 |
Correct |
3 ms |
1144 KB |
Output is correct |
23 |
Correct |
3 ms |
1144 KB |
Output is correct |
24 |
Correct |
3 ms |
1144 KB |
Output is correct |
25 |
Correct |
3 ms |
1148 KB |
Output is correct |
26 |
Correct |
3 ms |
1144 KB |
Output is correct |
27 |
Correct |
3 ms |
1144 KB |
Output is correct |
28 |
Correct |
6 ms |
1400 KB |
Output is correct |
29 |
Correct |
3 ms |
1144 KB |
Output is correct |
30 |
Correct |
3 ms |
1144 KB |
Output is correct |
31 |
Correct |
3 ms |
1144 KB |
Output is correct |
32 |
Correct |
4 ms |
1272 KB |
Output is correct |
33 |
Correct |
5 ms |
1400 KB |
Output is correct |
34 |
Correct |
6 ms |
1400 KB |
Output is correct |
35 |
Correct |
6 ms |
1400 KB |
Output is correct |
36 |
Correct |
4 ms |
1144 KB |
Output is correct |
37 |
Correct |
4 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
3 ms |
1144 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1144 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1144 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
19 |
Correct |
3 ms |
1144 KB |
Output is correct |
20 |
Correct |
3 ms |
1116 KB |
Output is correct |
21 |
Correct |
3 ms |
1144 KB |
Output is correct |
22 |
Correct |
3 ms |
1144 KB |
Output is correct |
23 |
Correct |
3 ms |
1144 KB |
Output is correct |
24 |
Correct |
3 ms |
1144 KB |
Output is correct |
25 |
Correct |
3 ms |
1148 KB |
Output is correct |
26 |
Correct |
3 ms |
1144 KB |
Output is correct |
27 |
Correct |
3 ms |
1144 KB |
Output is correct |
28 |
Correct |
6 ms |
1400 KB |
Output is correct |
29 |
Correct |
3 ms |
1144 KB |
Output is correct |
30 |
Correct |
3 ms |
1144 KB |
Output is correct |
31 |
Correct |
3 ms |
1144 KB |
Output is correct |
32 |
Correct |
4 ms |
1272 KB |
Output is correct |
33 |
Correct |
5 ms |
1400 KB |
Output is correct |
34 |
Correct |
6 ms |
1400 KB |
Output is correct |
35 |
Correct |
6 ms |
1400 KB |
Output is correct |
36 |
Correct |
4 ms |
1144 KB |
Output is correct |
37 |
Correct |
4 ms |
1144 KB |
Output is correct |
38 |
Incorrect |
97 ms |
2416 KB |
on inputs (13, 35), (39, 59), expected 1, but computed 0 |
39 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
4 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
5 ms |
1164 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1148 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1148 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
19 |
Correct |
3 ms |
1144 KB |
Output is correct |
20 |
Correct |
3 ms |
1144 KB |
Output is correct |
21 |
Correct |
3 ms |
1144 KB |
Output is correct |
22 |
Correct |
3 ms |
1144 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
15 ms |
1908 KB |
Output is correct |
4 |
Correct |
20 ms |
2292 KB |
Output is correct |
5 |
Correct |
16 ms |
1780 KB |
Output is correct |
6 |
Correct |
12 ms |
1404 KB |
Output is correct |
7 |
Correct |
9 ms |
1144 KB |
Output is correct |
8 |
Correct |
35 ms |
1908 KB |
Output is correct |
9 |
Incorrect |
44 ms |
2416 KB |
on inputs (0, 0), (43, 2), expected 1, but computed 0 |
10 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Execution timed out |
1070 ms |
1400 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
1144 KB |
Output is correct |
2 |
Correct |
3 ms |
1144 KB |
Output is correct |
3 |
Correct |
3 ms |
1144 KB |
Output is correct |
4 |
Correct |
3 ms |
1144 KB |
Output is correct |
5 |
Correct |
3 ms |
1144 KB |
Output is correct |
6 |
Correct |
3 ms |
1144 KB |
Output is correct |
7 |
Correct |
3 ms |
1144 KB |
Output is correct |
8 |
Correct |
3 ms |
1144 KB |
Output is correct |
9 |
Correct |
3 ms |
1144 KB |
Output is correct |
10 |
Correct |
3 ms |
1144 KB |
Output is correct |
11 |
Correct |
3 ms |
1144 KB |
Output is correct |
12 |
Correct |
3 ms |
1144 KB |
Output is correct |
13 |
Correct |
3 ms |
1144 KB |
Output is correct |
14 |
Correct |
3 ms |
1144 KB |
Output is correct |
15 |
Correct |
3 ms |
1144 KB |
Output is correct |
16 |
Correct |
3 ms |
1144 KB |
Output is correct |
17 |
Correct |
3 ms |
1144 KB |
Output is correct |
18 |
Correct |
3 ms |
1144 KB |
Output is correct |
19 |
Correct |
3 ms |
1144 KB |
Output is correct |
20 |
Correct |
3 ms |
1116 KB |
Output is correct |
21 |
Correct |
3 ms |
1144 KB |
Output is correct |
22 |
Correct |
3 ms |
1144 KB |
Output is correct |
23 |
Correct |
3 ms |
1144 KB |
Output is correct |
24 |
Correct |
3 ms |
1144 KB |
Output is correct |
25 |
Correct |
3 ms |
1148 KB |
Output is correct |
26 |
Correct |
3 ms |
1144 KB |
Output is correct |
27 |
Correct |
3 ms |
1144 KB |
Output is correct |
28 |
Correct |
6 ms |
1400 KB |
Output is correct |
29 |
Correct |
3 ms |
1144 KB |
Output is correct |
30 |
Correct |
3 ms |
1144 KB |
Output is correct |
31 |
Correct |
3 ms |
1144 KB |
Output is correct |
32 |
Correct |
4 ms |
1272 KB |
Output is correct |
33 |
Correct |
5 ms |
1400 KB |
Output is correct |
34 |
Correct |
6 ms |
1400 KB |
Output is correct |
35 |
Correct |
6 ms |
1400 KB |
Output is correct |
36 |
Correct |
4 ms |
1144 KB |
Output is correct |
37 |
Correct |
4 ms |
1144 KB |
Output is correct |
38 |
Incorrect |
97 ms |
2416 KB |
on inputs (13, 35), (39, 59), expected 1, but computed 0 |
39 |
Halted |
0 ms |
0 KB |
- |