#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
void construct_network(int H, int W, int K) {
int count=0,count2=0;
map<int,pair<int,int>> left,right;
for (int j=-H+1;j<W;j++){
vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) n.push_back(y*W+x);
y++;
x++;
}
count += 2;
count2 += n.size()*2;
int a = add_or(n);
int b = add_xor(n);
right[-j] = {a,b};
}
for (int j=0;j<W+H-1;j++){
vector<int> n;
int x=j,y=0;
while (y<H){
if (x>=0&&x<W) n.push_back(y*W+x);
y++;
x--;
}
count += 2;
count2 += n.size()*2;
int a = add_or(n);
int b = add_xor(n);
left[j] = {a,b};
}
vector<int> temp,temp2;
for (int i=H-1;i>-W-K;i--){
vector<int> n,n2;
for (int j=i+K;j>=i;j--){
if (right[j].first==right[j].second) continue;
n.push_back(right[j].first);
n2.push_back(right[j].second);
}
count += 4;
count2 += n.size()+n2.size()+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=0;i<W+H+K-1;i++){
vector<int> n,n2;
for (int j=i;j>=i-K;j--){
if (left[j].first==left[j].second) continue;
n.push_back(left[j].first);
n2.push_back(left[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
count += 3;
count2 += temp.size()+temp2.size()+2;
int a = add_or(temp);
int b = add_or(temp2);
int e = add_and({a,b});
temp.clear();
temp2.clear();
for (int i=H-1;i>-W-K+1;i--){
vector<int> n,n2;
for (int j=i+K-1;j>=i;j--){
if (right[j].first==right[j].second) continue;
n.push_back(right[j].first);
n2.push_back(right[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp.push_back(d);
}
for (int i=0;i<W+H+K-2;i++){
vector<int> n,n2;
for (int j=i;j>i-K;j--){
if (left[j].first==left[j].second) continue;
n.push_back(left[j].first);
n2.push_back(left[j].second);
}
count += 4;
count2 += n.size()*2+3;
int a = add_or(n);
int b = add_xor(n2);
int c = add_not(b);
int d = add_and({a,c});
temp2.push_back(d);
}
count += 5;
count2 += temp.size() + temp2.size() + 5;
a = add_or(temp);
b = add_or(temp2);
int e2 = add_and({a,b});
int e3 = add_not(e2);
int aa = add_and({e,e3});
//cout << count << " " << count2 << "\n";
}
Compilation message
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:110:6: warning: unused variable 'aa' [-Wunused-variable]
110 | int aa = add_and({e,e3});
| ^~
# |
Verdict |
Execution time |
Memory |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
3 ms |
600 KB |
Output is correct |
29 |
Correct |
2 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
4 ms |
600 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
2 ms |
604 KB |
Output is correct |
35 |
Correct |
3 ms |
604 KB |
Output is correct |
36 |
Correct |
5 ms |
604 KB |
Output is correct |
37 |
Correct |
5 ms |
860 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
3 ms |
600 KB |
Output is correct |
29 |
Correct |
2 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
4 ms |
600 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
2 ms |
604 KB |
Output is correct |
35 |
Correct |
3 ms |
604 KB |
Output is correct |
36 |
Correct |
5 ms |
604 KB |
Output is correct |
37 |
Correct |
5 ms |
860 KB |
Output is correct |
38 |
Correct |
15 ms |
1748 KB |
Output is correct |
39 |
Correct |
4 ms |
692 KB |
Output is correct |
40 |
Correct |
10 ms |
1116 KB |
Output is correct |
41 |
Correct |
4 ms |
824 KB |
Output is correct |
42 |
Correct |
27 ms |
2520 KB |
Output is correct |
43 |
Correct |
7 ms |
1068 KB |
Output is correct |
44 |
Correct |
15 ms |
1832 KB |
Output is correct |
45 |
Correct |
25 ms |
2764 KB |
Output is correct |
46 |
Correct |
35 ms |
3624 KB |
Output is correct |
47 |
Correct |
52 ms |
4432 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
604 KB |
Output is correct |
2 |
Correct |
25 ms |
1888 KB |
Output is correct |
3 |
Correct |
21 ms |
2008 KB |
Output is correct |
4 |
Correct |
44 ms |
3344 KB |
Output is correct |
5 |
Correct |
3 ms |
604 KB |
Output is correct |
6 |
Correct |
16 ms |
1496 KB |
Output is correct |
7 |
Correct |
28 ms |
2332 KB |
Output is correct |
8 |
Correct |
42 ms |
3316 KB |
Output is correct |
9 |
Correct |
3 ms |
604 KB |
Output is correct |
10 |
Correct |
14 ms |
1420 KB |
Output is correct |
11 |
Correct |
22 ms |
1888 KB |
Output is correct |
12 |
Correct |
23 ms |
2052 KB |
Output is correct |
13 |
Correct |
32 ms |
2588 KB |
Output is correct |
14 |
Correct |
42 ms |
3276 KB |
Output is correct |
15 |
Correct |
3 ms |
604 KB |
Output is correct |
16 |
Correct |
12 ms |
1240 KB |
Output is correct |
17 |
Correct |
21 ms |
2088 KB |
Output is correct |
18 |
Correct |
21 ms |
2096 KB |
Output is correct |
19 |
Correct |
34 ms |
2812 KB |
Output is correct |
20 |
Correct |
45 ms |
3468 KB |
Output is correct |
21 |
Correct |
0 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
604 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
3 ms |
604 KB |
Output is correct |
4 |
Correct |
6 ms |
860 KB |
Output is correct |
5 |
Correct |
14 ms |
1372 KB |
Output is correct |
6 |
Correct |
17 ms |
1512 KB |
Output is correct |
7 |
Correct |
19 ms |
2008 KB |
Output is correct |
8 |
Correct |
4 ms |
860 KB |
Output is correct |
9 |
Correct |
12 ms |
1492 KB |
Output is correct |
10 |
Correct |
19 ms |
2024 KB |
Output is correct |
11 |
Correct |
27 ms |
2528 KB |
Output is correct |
12 |
Correct |
40 ms |
3276 KB |
Output is correct |
13 |
Correct |
3 ms |
604 KB |
Output is correct |
14 |
Correct |
13 ms |
1572 KB |
Output is correct |
15 |
Correct |
29 ms |
2596 KB |
Output is correct |
16 |
Correct |
41 ms |
3252 KB |
Output is correct |
17 |
Correct |
2 ms |
856 KB |
Output is correct |
18 |
Correct |
21 ms |
2008 KB |
Output is correct |
19 |
Correct |
41 ms |
3408 KB |
Output is correct |
20 |
Correct |
9 ms |
1492 KB |
Output is correct |
21 |
Correct |
37 ms |
3924 KB |
Output is correct |
22 |
Correct |
67 ms |
6604 KB |
Output is correct |
23 |
Incorrect |
37 ms |
4052 KB |
WA in grader: Too many instructions |
24 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
18 ms |
2520 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
2 ms |
604 KB |
Output is correct |
4 |
Correct |
4 ms |
860 KB |
Output is correct |
5 |
Correct |
2 ms |
604 KB |
Output is correct |
6 |
Correct |
2 ms |
600 KB |
Output is correct |
7 |
Correct |
9 ms |
1676 KB |
Output is correct |
8 |
Correct |
9 ms |
1496 KB |
Output is correct |
9 |
Correct |
18 ms |
2564 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
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 |
0 ms |
348 KB |
Output is correct |
6 |
Correct |
0 ms |
348 KB |
Output is correct |
7 |
Correct |
1 ms |
348 KB |
Output is correct |
8 |
Correct |
0 ms |
348 KB |
Output is correct |
9 |
Correct |
1 ms |
348 KB |
Output is correct |
10 |
Correct |
0 ms |
348 KB |
Output is correct |
11 |
Correct |
1 ms |
348 KB |
Output is correct |
12 |
Correct |
0 ms |
348 KB |
Output is correct |
13 |
Correct |
0 ms |
348 KB |
Output is correct |
14 |
Correct |
0 ms |
432 KB |
Output is correct |
15 |
Correct |
1 ms |
348 KB |
Output is correct |
16 |
Correct |
0 ms |
348 KB |
Output is correct |
17 |
Correct |
1 ms |
348 KB |
Output is correct |
18 |
Correct |
1 ms |
344 KB |
Output is correct |
19 |
Correct |
0 ms |
348 KB |
Output is correct |
20 |
Correct |
1 ms |
348 KB |
Output is correct |
21 |
Correct |
1 ms |
348 KB |
Output is correct |
22 |
Correct |
1 ms |
344 KB |
Output is correct |
23 |
Correct |
1 ms |
344 KB |
Output is correct |
24 |
Correct |
1 ms |
348 KB |
Output is correct |
25 |
Correct |
1 ms |
348 KB |
Output is correct |
26 |
Correct |
1 ms |
348 KB |
Output is correct |
27 |
Correct |
1 ms |
344 KB |
Output is correct |
28 |
Correct |
3 ms |
600 KB |
Output is correct |
29 |
Correct |
2 ms |
348 KB |
Output is correct |
30 |
Correct |
1 ms |
348 KB |
Output is correct |
31 |
Correct |
4 ms |
600 KB |
Output is correct |
32 |
Correct |
1 ms |
348 KB |
Output is correct |
33 |
Correct |
1 ms |
348 KB |
Output is correct |
34 |
Correct |
2 ms |
604 KB |
Output is correct |
35 |
Correct |
3 ms |
604 KB |
Output is correct |
36 |
Correct |
5 ms |
604 KB |
Output is correct |
37 |
Correct |
5 ms |
860 KB |
Output is correct |
38 |
Correct |
15 ms |
1748 KB |
Output is correct |
39 |
Correct |
4 ms |
692 KB |
Output is correct |
40 |
Correct |
10 ms |
1116 KB |
Output is correct |
41 |
Correct |
4 ms |
824 KB |
Output is correct |
42 |
Correct |
27 ms |
2520 KB |
Output is correct |
43 |
Correct |
7 ms |
1068 KB |
Output is correct |
44 |
Correct |
15 ms |
1832 KB |
Output is correct |
45 |
Correct |
25 ms |
2764 KB |
Output is correct |
46 |
Correct |
35 ms |
3624 KB |
Output is correct |
47 |
Correct |
52 ms |
4432 KB |
Output is correct |
48 |
Correct |
2 ms |
604 KB |
Output is correct |
49 |
Correct |
25 ms |
1888 KB |
Output is correct |
50 |
Correct |
21 ms |
2008 KB |
Output is correct |
51 |
Correct |
44 ms |
3344 KB |
Output is correct |
52 |
Correct |
3 ms |
604 KB |
Output is correct |
53 |
Correct |
16 ms |
1496 KB |
Output is correct |
54 |
Correct |
28 ms |
2332 KB |
Output is correct |
55 |
Correct |
42 ms |
3316 KB |
Output is correct |
56 |
Correct |
3 ms |
604 KB |
Output is correct |
57 |
Correct |
14 ms |
1420 KB |
Output is correct |
58 |
Correct |
22 ms |
1888 KB |
Output is correct |
59 |
Correct |
23 ms |
2052 KB |
Output is correct |
60 |
Correct |
32 ms |
2588 KB |
Output is correct |
61 |
Correct |
42 ms |
3276 KB |
Output is correct |
62 |
Correct |
3 ms |
604 KB |
Output is correct |
63 |
Correct |
12 ms |
1240 KB |
Output is correct |
64 |
Correct |
21 ms |
2088 KB |
Output is correct |
65 |
Correct |
21 ms |
2096 KB |
Output is correct |
66 |
Correct |
34 ms |
2812 KB |
Output is correct |
67 |
Correct |
45 ms |
3468 KB |
Output is correct |
68 |
Correct |
0 ms |
348 KB |
Output is correct |
69 |
Correct |
1 ms |
604 KB |
Output is correct |
70 |
Correct |
0 ms |
344 KB |
Output is correct |
71 |
Correct |
0 ms |
348 KB |
Output is correct |
72 |
Correct |
3 ms |
604 KB |
Output is correct |
73 |
Correct |
6 ms |
860 KB |
Output is correct |
74 |
Correct |
14 ms |
1372 KB |
Output is correct |
75 |
Correct |
17 ms |
1512 KB |
Output is correct |
76 |
Correct |
19 ms |
2008 KB |
Output is correct |
77 |
Correct |
4 ms |
860 KB |
Output is correct |
78 |
Correct |
12 ms |
1492 KB |
Output is correct |
79 |
Correct |
19 ms |
2024 KB |
Output is correct |
80 |
Correct |
27 ms |
2528 KB |
Output is correct |
81 |
Correct |
40 ms |
3276 KB |
Output is correct |
82 |
Correct |
3 ms |
604 KB |
Output is correct |
83 |
Correct |
13 ms |
1572 KB |
Output is correct |
84 |
Correct |
29 ms |
2596 KB |
Output is correct |
85 |
Correct |
41 ms |
3252 KB |
Output is correct |
86 |
Correct |
2 ms |
856 KB |
Output is correct |
87 |
Correct |
21 ms |
2008 KB |
Output is correct |
88 |
Correct |
41 ms |
3408 KB |
Output is correct |
89 |
Correct |
9 ms |
1492 KB |
Output is correct |
90 |
Correct |
37 ms |
3924 KB |
Output is correct |
91 |
Correct |
67 ms |
6604 KB |
Output is correct |
92 |
Incorrect |
37 ms |
4052 KB |
WA in grader: Too many instructions |
93 |
Halted |
0 ms |
0 KB |
- |