답안 #981202

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
981202 2024-05-13T02:04:41 Z WongYiKai Vision Program (IOI19_vision) C++14
100 / 100
111 ms 8992 KB
#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-K;i>-W;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=K;i<W+H-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});
      |      ^~
# 결과 실행 시간 메모리 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 0 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 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 600 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 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 344 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 0 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 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 600 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 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 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 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 0 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 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 600 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 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 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 348 KB Output is correct
28 Correct 2 ms 604 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 2 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 604 KB Output is correct
35 Correct 2 ms 604 KB Output is correct
36 Correct 3 ms 624 KB Output is correct
37 Correct 3 ms 604 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 0 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 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 600 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 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 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 348 KB Output is correct
28 Correct 2 ms 604 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 2 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 604 KB Output is correct
35 Correct 2 ms 604 KB Output is correct
36 Correct 3 ms 624 KB Output is correct
37 Correct 3 ms 604 KB Output is correct
38 Correct 15 ms 1624 KB Output is correct
39 Correct 3 ms 604 KB Output is correct
40 Correct 5 ms 856 KB Output is correct
41 Correct 4 ms 856 KB Output is correct
42 Correct 14 ms 1640 KB Output is correct
43 Correct 5 ms 1116 KB Output is correct
44 Correct 13 ms 1880 KB Output is correct
45 Correct 18 ms 2136 KB Output is correct
46 Correct 25 ms 2652 KB Output is correct
47 Correct 25 ms 2644 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 600 KB Output is correct
2 Correct 15 ms 1628 KB Output is correct
3 Correct 15 ms 1628 KB Output is correct
4 Correct 21 ms 1880 KB Output is correct
5 Correct 2 ms 600 KB Output is correct
6 Correct 11 ms 1372 KB Output is correct
7 Correct 18 ms 1884 KB Output is correct
8 Correct 21 ms 1880 KB Output is correct
9 Correct 2 ms 604 KB Output is correct
10 Correct 10 ms 1116 KB Output is correct
11 Correct 15 ms 1624 KB Output is correct
12 Correct 15 ms 1628 KB Output is correct
13 Correct 19 ms 1884 KB Output is correct
14 Correct 21 ms 1884 KB Output is correct
15 Correct 2 ms 600 KB Output is correct
16 Correct 10 ms 1112 KB Output is correct
17 Correct 15 ms 1628 KB Output is correct
18 Correct 15 ms 1628 KB Output is correct
19 Correct 19 ms 1884 KB Output is correct
20 Correct 21 ms 1880 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 3 ms 604 KB Output is correct
4 Correct 5 ms 860 KB Output is correct
5 Correct 8 ms 1096 KB Output is correct
6 Correct 9 ms 1116 KB Output is correct
7 Correct 14 ms 1116 KB Output is correct
8 Correct 4 ms 860 KB Output is correct
9 Correct 12 ms 1368 KB Output is correct
10 Correct 14 ms 1628 KB Output is correct
11 Correct 17 ms 1884 KB Output is correct
12 Correct 19 ms 1884 KB Output is correct
13 Correct 2 ms 600 KB Output is correct
14 Correct 11 ms 1372 KB Output is correct
15 Correct 18 ms 1884 KB Output is correct
16 Correct 21 ms 2140 KB Output is correct
17 Correct 3 ms 604 KB Output is correct
18 Correct 15 ms 1628 KB Output is correct
19 Correct 21 ms 2060 KB Output is correct
20 Correct 9 ms 1496 KB Output is correct
21 Correct 32 ms 3536 KB Output is correct
22 Correct 46 ms 4828 KB Output is correct
23 Correct 55 ms 5072 KB Output is correct
24 Correct 9 ms 1492 KB Output is correct
25 Correct 39 ms 4312 KB Output is correct
26 Correct 56 ms 5068 KB Output is correct
27 Correct 16 ms 2516 KB Output is correct
28 Correct 48 ms 5196 KB Output is correct
29 Correct 70 ms 7144 KB Output is correct
30 Correct 88 ms 8328 KB Output is correct
31 Correct 110 ms 8912 KB Output is correct
32 Correct 0 ms 344 KB Output is correct
33 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 16 ms 2520 KB Output is correct
2 Correct 0 ms 344 KB Output is correct
3 Correct 2 ms 600 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 604 KB Output is correct
7 Correct 9 ms 1560 KB Output is correct
8 Correct 9 ms 1496 KB Output is correct
9 Correct 16 ms 2516 KB Output is correct
10 Correct 1 ms 344 KB Output is correct
11 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 0 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 0 ms 348 KB Output is correct
8 Correct 0 ms 344 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 0 ms 348 KB Output is correct
11 Correct 1 ms 600 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 348 KB Output is correct
15 Correct 0 ms 348 KB Output is correct
16 Correct 0 ms 348 KB Output is correct
17 Correct 0 ms 344 KB Output is correct
18 Correct 0 ms 344 KB Output is correct
19 Correct 0 ms 348 KB Output is correct
20 Correct 0 ms 348 KB Output is correct
21 Correct 1 ms 348 KB Output is correct
22 Correct 1 ms 348 KB Output is correct
23 Correct 0 ms 348 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 348 KB Output is correct
28 Correct 2 ms 604 KB Output is correct
29 Correct 1 ms 348 KB Output is correct
30 Correct 1 ms 348 KB Output is correct
31 Correct 2 ms 348 KB Output is correct
32 Correct 1 ms 344 KB Output is correct
33 Correct 1 ms 348 KB Output is correct
34 Correct 2 ms 604 KB Output is correct
35 Correct 2 ms 604 KB Output is correct
36 Correct 3 ms 624 KB Output is correct
37 Correct 3 ms 604 KB Output is correct
38 Correct 15 ms 1624 KB Output is correct
39 Correct 3 ms 604 KB Output is correct
40 Correct 5 ms 856 KB Output is correct
41 Correct 4 ms 856 KB Output is correct
42 Correct 14 ms 1640 KB Output is correct
43 Correct 5 ms 1116 KB Output is correct
44 Correct 13 ms 1880 KB Output is correct
45 Correct 18 ms 2136 KB Output is correct
46 Correct 25 ms 2652 KB Output is correct
47 Correct 25 ms 2644 KB Output is correct
48 Correct 2 ms 600 KB Output is correct
49 Correct 15 ms 1628 KB Output is correct
50 Correct 15 ms 1628 KB Output is correct
51 Correct 21 ms 1880 KB Output is correct
52 Correct 2 ms 600 KB Output is correct
53 Correct 11 ms 1372 KB Output is correct
54 Correct 18 ms 1884 KB Output is correct
55 Correct 21 ms 1880 KB Output is correct
56 Correct 2 ms 604 KB Output is correct
57 Correct 10 ms 1116 KB Output is correct
58 Correct 15 ms 1624 KB Output is correct
59 Correct 15 ms 1628 KB Output is correct
60 Correct 19 ms 1884 KB Output is correct
61 Correct 21 ms 1884 KB Output is correct
62 Correct 2 ms 600 KB Output is correct
63 Correct 10 ms 1112 KB Output is correct
64 Correct 15 ms 1628 KB Output is correct
65 Correct 15 ms 1628 KB Output is correct
66 Correct 19 ms 1884 KB Output is correct
67 Correct 21 ms 1880 KB Output is correct
68 Correct 1 ms 348 KB Output is correct
69 Correct 0 ms 348 KB Output is correct
70 Correct 0 ms 348 KB Output is correct
71 Correct 0 ms 348 KB Output is correct
72 Correct 3 ms 604 KB Output is correct
73 Correct 5 ms 860 KB Output is correct
74 Correct 8 ms 1096 KB Output is correct
75 Correct 9 ms 1116 KB Output is correct
76 Correct 14 ms 1116 KB Output is correct
77 Correct 4 ms 860 KB Output is correct
78 Correct 12 ms 1368 KB Output is correct
79 Correct 14 ms 1628 KB Output is correct
80 Correct 17 ms 1884 KB Output is correct
81 Correct 19 ms 1884 KB Output is correct
82 Correct 2 ms 600 KB Output is correct
83 Correct 11 ms 1372 KB Output is correct
84 Correct 18 ms 1884 KB Output is correct
85 Correct 21 ms 2140 KB Output is correct
86 Correct 3 ms 604 KB Output is correct
87 Correct 15 ms 1628 KB Output is correct
88 Correct 21 ms 2060 KB Output is correct
89 Correct 9 ms 1496 KB Output is correct
90 Correct 32 ms 3536 KB Output is correct
91 Correct 46 ms 4828 KB Output is correct
92 Correct 55 ms 5072 KB Output is correct
93 Correct 9 ms 1492 KB Output is correct
94 Correct 39 ms 4312 KB Output is correct
95 Correct 56 ms 5068 KB Output is correct
96 Correct 16 ms 2516 KB Output is correct
97 Correct 48 ms 5196 KB Output is correct
98 Correct 70 ms 7144 KB Output is correct
99 Correct 88 ms 8328 KB Output is correct
100 Correct 110 ms 8912 KB Output is correct
101 Correct 0 ms 344 KB Output is correct
102 Correct 1 ms 344 KB Output is correct
103 Correct 16 ms 2520 KB Output is correct
104 Correct 0 ms 344 KB Output is correct
105 Correct 2 ms 600 KB Output is correct
106 Correct 4 ms 860 KB Output is correct
107 Correct 2 ms 604 KB Output is correct
108 Correct 2 ms 604 KB Output is correct
109 Correct 9 ms 1560 KB Output is correct
110 Correct 9 ms 1496 KB Output is correct
111 Correct 16 ms 2516 KB Output is correct
112 Correct 1 ms 344 KB Output is correct
113 Correct 0 ms 348 KB Output is correct
114 Correct 49 ms 5584 KB Output is correct
115 Correct 21 ms 1884 KB Output is correct
116 Correct 2 ms 604 KB Output is correct
117 Correct 51 ms 4948 KB Output is correct
118 Correct 21 ms 2520 KB Output is correct
119 Correct 71 ms 7624 KB Output is correct
120 Correct 70 ms 7116 KB Output is correct
121 Correct 70 ms 7116 KB Output is correct
122 Correct 71 ms 7112 KB Output is correct
123 Correct 16 ms 2516 KB Output is correct
124 Correct 47 ms 5324 KB Output is correct
125 Correct 70 ms 7284 KB Output is correct
126 Correct 70 ms 7116 KB Output is correct
127 Correct 89 ms 8396 KB Output is correct
128 Correct 111 ms 8992 KB Output is correct