답안 #143268

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
143268 2019-08-13T13:14:14 Z Kerim Vision Program (IOI19_vision) C++17
100 / 100
105 ms 10736 KB
#include "vision.h"
#include "bits/stdc++.h"
#define MAXN 100009
#define INF 1000000007
#define mp(x,y) make_pair(x,y)
#define all(v) v.begin(),v.end()
#define pb(x) push_back(x)
#define wr cout<<"----------------"<<endl;
#define ppb() pop_back()
#define tr(ii,c) for(__typeof((c).begin()) ii=(c).begin();ii!=(c).end();ii++)
#define ff first
#define ss second
#define my_little_dodge 46
#define debug(x)  cerr<< #x <<" = "<< x<<endl;
#define debug2(x,y)  cerr<< #x <<" = "<< x<<" "<< #y <<" = "<< y<<endl;
using namespace std;
int _add(int x,int y){
	vector<int>v;
	v.pb(x);v.pb(y);
	return add_and(v);	
}
int _or(int x,int y){
	vector<int>v;
	v.pb(x);v.pb(y);
	return add_or(v);	
}
int _xor(int x,int y){
	vector<int>v;
	v.pb(x);v.pb(y);
	return add_xor(v);	
}
int n,m;
const int N=202;
vector<int>adj[2*N];
int res_or[2*N],res_xor[2*N];
int solve(int t,int dis){
	if(!t){
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++)
				adj[i+j].pb(i*m+j);
	}
	else{
		for(int i=0;i<n;i++)
			for(int j=0;j<m;j++)
				adj[i-j+N].pb(i*m+j);
	}
	vector<int>ans;
	int l=-1,r;
	for(int i=0;i<2*N;i++){
		if(adj[i].size()){
			if(l==-1)
				l=i;
			r=i;
			res_or[i]=add_or(adj[i]);
			res_xor[i]=add_xor(adj[i]);	
		}
		adj[i].clear();
	}
	for(int i=l;i<=r;i++){
		vector<int>tmp;
		for(int j=max(l,i-dis);j<=min(r,i+dis);j++)
			if(i!=j)
				tmp.pb(res_or[j]);	
		tmp.pb(add_not(res_or[i]));		
		tmp.pb(_xor(res_or[i],res_xor[i]));
		ans.pb(add_not(add_or(tmp)));	
	}
	return add_or(ans);
}
void construct_network(int H, int W, int K) {n=H;m=W;
	_xor(_or(solve(0,K),solve(1,K)),_or(solve(0,K-1),solve(1,K-1)));	
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
28 Correct 4 ms 504 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 3 ms 376 KB Output is correct
31 Correct 4 ms 504 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 4 ms 504 KB Output is correct
35 Correct 5 ms 632 KB Output is correct
36 Correct 5 ms 632 KB Output is correct
37 Correct 5 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
28 Correct 4 ms 504 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 3 ms 376 KB Output is correct
31 Correct 4 ms 504 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 4 ms 504 KB Output is correct
35 Correct 5 ms 632 KB Output is correct
36 Correct 5 ms 632 KB Output is correct
37 Correct 5 ms 632 KB Output is correct
38 Correct 20 ms 2164 KB Output is correct
39 Correct 5 ms 760 KB Output is correct
40 Correct 7 ms 892 KB Output is correct
41 Correct 8 ms 1016 KB Output is correct
42 Correct 17 ms 1784 KB Output is correct
43 Correct 13 ms 1524 KB Output is correct
44 Correct 20 ms 2164 KB Output is correct
45 Correct 25 ms 2676 KB Output is correct
46 Correct 34 ms 2912 KB Output is correct
47 Correct 34 ms 3056 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 764 KB Output is correct
2 Correct 17 ms 1780 KB Output is correct
3 Correct 17 ms 1780 KB Output is correct
4 Correct 20 ms 2036 KB Output is correct
5 Correct 5 ms 760 KB Output is correct
6 Correct 14 ms 1524 KB Output is correct
7 Correct 20 ms 1908 KB Output is correct
8 Correct 20 ms 2032 KB Output is correct
9 Correct 5 ms 760 KB Output is correct
10 Correct 14 ms 1268 KB Output is correct
11 Correct 17 ms 1784 KB Output is correct
12 Correct 17 ms 1780 KB Output is correct
13 Correct 21 ms 2036 KB Output is correct
14 Correct 21 ms 2036 KB Output is correct
15 Correct 5 ms 760 KB Output is correct
16 Correct 12 ms 1268 KB Output is correct
17 Correct 17 ms 1780 KB Output is correct
18 Correct 17 ms 1780 KB Output is correct
19 Correct 20 ms 2036 KB Output is correct
20 Correct 21 ms 2036 KB Output is correct
21 Correct 2 ms 256 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 380 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 6 ms 760 KB Output is correct
4 Correct 11 ms 1016 KB Output is correct
5 Correct 12 ms 1272 KB Output is correct
6 Correct 12 ms 1372 KB Output is correct
7 Correct 13 ms 1400 KB Output is correct
8 Correct 9 ms 1140 KB Output is correct
9 Correct 15 ms 1652 KB Output is correct
10 Correct 20 ms 1908 KB Output is correct
11 Correct 21 ms 2164 KB Output is correct
12 Correct 23 ms 2292 KB Output is correct
13 Correct 5 ms 760 KB Output is correct
14 Correct 13 ms 1368 KB Output is correct
15 Correct 19 ms 1912 KB Output is correct
16 Correct 21 ms 2036 KB Output is correct
17 Correct 5 ms 760 KB Output is correct
18 Correct 17 ms 1716 KB Output is correct
19 Correct 20 ms 2036 KB Output is correct
20 Correct 22 ms 2552 KB Output is correct
21 Correct 43 ms 4472 KB Output is correct
22 Correct 47 ms 5748 KB Output is correct
23 Correct 60 ms 6004 KB Output is correct
24 Correct 22 ms 2548 KB Output is correct
25 Correct 50 ms 5108 KB Output is correct
26 Correct 59 ms 6004 KB Output is correct
27 Correct 40 ms 4336 KB Output is correct
28 Correct 69 ms 7024 KB Output is correct
29 Correct 90 ms 9072 KB Output is correct
30 Correct 102 ms 10324 KB Output is correct
31 Correct 105 ms 10736 KB Output is correct
32 Correct 2 ms 256 KB Output is correct
33 Correct 2 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 42 ms 4288 KB Output is correct
2 Correct 2 ms 252 KB Output is correct
3 Correct 6 ms 760 KB Output is correct
4 Correct 9 ms 1140 KB Output is correct
5 Correct 5 ms 760 KB Output is correct
6 Correct 5 ms 760 KB Output is correct
7 Correct 22 ms 2548 KB Output is correct
8 Correct 23 ms 2420 KB Output is correct
9 Correct 40 ms 4336 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 256 KB Output is correct
5 Correct 2 ms 376 KB Output is correct
6 Correct 2 ms 376 KB Output is correct
7 Correct 2 ms 376 KB Output is correct
8 Correct 2 ms 376 KB Output is correct
9 Correct 2 ms 376 KB Output is correct
10 Correct 2 ms 376 KB Output is correct
11 Correct 2 ms 376 KB Output is correct
12 Correct 2 ms 376 KB Output is correct
13 Correct 2 ms 376 KB Output is correct
14 Correct 2 ms 376 KB Output is correct
15 Correct 2 ms 376 KB Output is correct
16 Correct 2 ms 376 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 2 ms 376 KB Output is correct
19 Correct 2 ms 376 KB Output is correct
20 Correct 2 ms 376 KB Output is correct
21 Correct 2 ms 376 KB Output is correct
22 Correct 2 ms 376 KB Output is correct
23 Correct 2 ms 376 KB Output is correct
24 Correct 2 ms 376 KB Output is correct
25 Correct 2 ms 376 KB Output is correct
26 Correct 3 ms 376 KB Output is correct
27 Correct 2 ms 376 KB Output is correct
28 Correct 4 ms 504 KB Output is correct
29 Correct 3 ms 376 KB Output is correct
30 Correct 3 ms 376 KB Output is correct
31 Correct 4 ms 504 KB Output is correct
32 Correct 3 ms 504 KB Output is correct
33 Correct 4 ms 504 KB Output is correct
34 Correct 4 ms 504 KB Output is correct
35 Correct 5 ms 632 KB Output is correct
36 Correct 5 ms 632 KB Output is correct
37 Correct 5 ms 632 KB Output is correct
38 Correct 20 ms 2164 KB Output is correct
39 Correct 5 ms 760 KB Output is correct
40 Correct 7 ms 892 KB Output is correct
41 Correct 8 ms 1016 KB Output is correct
42 Correct 17 ms 1784 KB Output is correct
43 Correct 13 ms 1524 KB Output is correct
44 Correct 20 ms 2164 KB Output is correct
45 Correct 25 ms 2676 KB Output is correct
46 Correct 34 ms 2912 KB Output is correct
47 Correct 34 ms 3056 KB Output is correct
48 Correct 5 ms 764 KB Output is correct
49 Correct 17 ms 1780 KB Output is correct
50 Correct 17 ms 1780 KB Output is correct
51 Correct 20 ms 2036 KB Output is correct
52 Correct 5 ms 760 KB Output is correct
53 Correct 14 ms 1524 KB Output is correct
54 Correct 20 ms 1908 KB Output is correct
55 Correct 20 ms 2032 KB Output is correct
56 Correct 5 ms 760 KB Output is correct
57 Correct 14 ms 1268 KB Output is correct
58 Correct 17 ms 1784 KB Output is correct
59 Correct 17 ms 1780 KB Output is correct
60 Correct 21 ms 2036 KB Output is correct
61 Correct 21 ms 2036 KB Output is correct
62 Correct 5 ms 760 KB Output is correct
63 Correct 12 ms 1268 KB Output is correct
64 Correct 17 ms 1780 KB Output is correct
65 Correct 17 ms 1780 KB Output is correct
66 Correct 20 ms 2036 KB Output is correct
67 Correct 21 ms 2036 KB Output is correct
68 Correct 2 ms 256 KB Output is correct
69 Correct 2 ms 376 KB Output is correct
70 Correct 2 ms 380 KB Output is correct
71 Correct 2 ms 376 KB Output is correct
72 Correct 6 ms 760 KB Output is correct
73 Correct 11 ms 1016 KB Output is correct
74 Correct 12 ms 1272 KB Output is correct
75 Correct 12 ms 1372 KB Output is correct
76 Correct 13 ms 1400 KB Output is correct
77 Correct 9 ms 1140 KB Output is correct
78 Correct 15 ms 1652 KB Output is correct
79 Correct 20 ms 1908 KB Output is correct
80 Correct 21 ms 2164 KB Output is correct
81 Correct 23 ms 2292 KB Output is correct
82 Correct 5 ms 760 KB Output is correct
83 Correct 13 ms 1368 KB Output is correct
84 Correct 19 ms 1912 KB Output is correct
85 Correct 21 ms 2036 KB Output is correct
86 Correct 5 ms 760 KB Output is correct
87 Correct 17 ms 1716 KB Output is correct
88 Correct 20 ms 2036 KB Output is correct
89 Correct 22 ms 2552 KB Output is correct
90 Correct 43 ms 4472 KB Output is correct
91 Correct 47 ms 5748 KB Output is correct
92 Correct 60 ms 6004 KB Output is correct
93 Correct 22 ms 2548 KB Output is correct
94 Correct 50 ms 5108 KB Output is correct
95 Correct 59 ms 6004 KB Output is correct
96 Correct 40 ms 4336 KB Output is correct
97 Correct 69 ms 7024 KB Output is correct
98 Correct 90 ms 9072 KB Output is correct
99 Correct 102 ms 10324 KB Output is correct
100 Correct 105 ms 10736 KB Output is correct
101 Correct 2 ms 256 KB Output is correct
102 Correct 2 ms 376 KB Output is correct
103 Correct 42 ms 4288 KB Output is correct
104 Correct 2 ms 252 KB Output is correct
105 Correct 6 ms 760 KB Output is correct
106 Correct 9 ms 1140 KB Output is correct
107 Correct 5 ms 760 KB Output is correct
108 Correct 5 ms 760 KB Output is correct
109 Correct 22 ms 2548 KB Output is correct
110 Correct 23 ms 2420 KB Output is correct
111 Correct 40 ms 4336 KB Output is correct
112 Correct 2 ms 376 KB Output is correct
113 Correct 2 ms 256 KB Output is correct
114 Correct 68 ms 6996 KB Output is correct
115 Correct 20 ms 2036 KB Output is correct
116 Correct 5 ms 760 KB Output is correct
117 Correct 59 ms 5944 KB Output is correct
118 Correct 34 ms 3464 KB Output is correct
119 Correct 88 ms 8944 KB Output is correct
120 Correct 88 ms 8940 KB Output is correct
121 Correct 88 ms 9072 KB Output is correct
122 Correct 90 ms 9072 KB Output is correct
123 Correct 40 ms 4336 KB Output is correct
124 Correct 69 ms 7188 KB Output is correct
125 Correct 89 ms 9072 KB Output is correct
126 Correct 89 ms 9072 KB Output is correct
127 Correct 104 ms 10312 KB Output is correct
128 Correct 104 ms 10604 KB Output is correct