답안 #198773

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
198773 2020-01-27T15:21:00 Z Akashi Vision Program (IOI19_vision) C++14
44 / 100
20 ms 3188 KB
#include <bits/stdc++.h>
#include "vision.h"
 
using namespace std;
 
bool viz[205][205], cul[205][205];
int wh[205][205];
int H, W, K;
void paint(int i, int j){
	if(cul[i][j]) return ;
	for(int x = -K; x <= K ; ++x){
		int y = K - abs(x);
	
		int l = i + x, c = j + y; 
		if(l >= 0 && c >= 0 && l < H && c < W) cul[l][c] = 1;
	
		y = -y; l = i + x, c = j + y; 
		if(l >= 0 && c >= 0 && l < H && c < W) cul[l][c] = 1;
		
	}
}
 
void construct_network(int n, int m, int k) {
	vector <int> v;
 
	H = n; W = m; K = k;
 
	int mi = H / 2, mj = W / 2;
	for(int d = 0; d <= max(H, W) ; ++d){
		for(int i = max(0, mi - d); i <= max(H - 1, mi + d) ; ++i){
			if(mj - d >= 0) paint(i, mj - d);
			if(mj + d < W) paint(i, mj + d);
		}
		
		for(int j = max(0, mj - d); j <= max(W - 1, mj + d) ; ++j){
			if(mi - d >= 0) paint(mi - d, j);
			if(mi + d < H) paint(mi + d, j);
		}
	}
 
	int Last = 0;
	for(int i = 0; i < H ; ++i){
		for(int j = 0; j < W ; ++j){
			if(!cul[i][j]) continue ;
			viz[i][j] = 1;
			v.clear();
	
			for(int x = -K; x <= K ; ++x){
				int y = K - abs(x);
				int l = i + x, c = j + y; 
		
				if(l >= 0 && c >= 0 && l < H && c < W){
					if(!viz[l][c]) v.push_back(l * W + c);
				}
				
				y = -y;
				l = i + x, c = j + y; 
		
				if(l >= 0 && c >= 0 && l < H && c < W){
					if(!viz[l][c]) v.push_back(l * W + c);
				}
			}
	
			if(v.size() == 0) continue ;
			wh[i][j] = add_or(v);
			Last = wh[i][j];
		}
	}
	
	int st = Last + 1, dr = 0;
	for(int i = 0; i < H ; ++i){
		for(int j = 0; j < W ; ++j){
			if(wh[i][j]){
				vector <int> v;
				v.push_back(i * W + j);
				v.push_back(wh[i][j]);
				dr = add_and(v);
			}
		}
	}
	
	v.clear();
	for(int i = st; i <= dr ; ++i) v.push_back(i);
	add_or(v);
 
	return ;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 296 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 6 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 296 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 6 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 376 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 6 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 5 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 296 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 6 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 376 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 6 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 5 ms 376 KB Output is correct
28 Correct 8 ms 508 KB Output is correct
29 Correct 5 ms 256 KB Output is correct
30 Correct 5 ms 376 KB Output is correct
31 Correct 5 ms 376 KB Output is correct
32 Correct 6 ms 376 KB Output is correct
33 Correct 6 ms 376 KB Output is correct
34 Correct 8 ms 632 KB Output is correct
35 Correct 7 ms 504 KB Output is correct
36 Correct 6 ms 376 KB Output is correct
37 Correct 6 ms 376 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 296 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 6 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 376 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 6 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 5 ms 376 KB Output is correct
28 Correct 8 ms 508 KB Output is correct
29 Correct 5 ms 256 KB Output is correct
30 Correct 5 ms 376 KB Output is correct
31 Correct 5 ms 376 KB Output is correct
32 Correct 6 ms 376 KB Output is correct
33 Correct 6 ms 376 KB Output is correct
34 Correct 8 ms 632 KB Output is correct
35 Correct 7 ms 504 KB Output is correct
36 Correct 6 ms 376 KB Output is correct
37 Correct 6 ms 376 KB Output is correct
38 Incorrect 17 ms 3188 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 10 ms 376 KB Output is correct
3 Correct 14 ms 376 KB Output is correct
4 Correct 20 ms 256 KB Output is correct
5 Correct 6 ms 632 KB Output is correct
6 Correct 10 ms 504 KB Output is correct
7 Correct 13 ms 504 KB Output is correct
8 Correct 17 ms 376 KB Output is correct
9 Correct 6 ms 376 KB Output is correct
10 Correct 8 ms 376 KB Output is correct
11 Correct 11 ms 376 KB Output is correct
12 Correct 10 ms 376 KB Output is correct
13 Correct 13 ms 256 KB Output is correct
14 Correct 19 ms 256 KB Output is correct
15 Correct 6 ms 636 KB Output is correct
16 Correct 11 ms 504 KB Output is correct
17 Correct 12 ms 504 KB Output is correct
18 Correct 18 ms 504 KB Output is correct
19 Correct 14 ms 380 KB Output is correct
20 Correct 19 ms 376 KB Output is correct
21 Correct 5 ms 256 KB Output is correct
22 Correct 5 ms 256 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 256 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 8 ms 740 KB Output is correct
4 Correct 17 ms 1396 KB Output is correct
5 Correct 14 ms 1016 KB Output is correct
6 Correct 11 ms 632 KB Output is correct
7 Correct 11 ms 376 KB Output is correct
8 Correct 11 ms 884 KB Output is correct
9 Incorrect 12 ms 1780 KB WA in grader: Too many instructions
10 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 8 ms 1268 KB WA in grader: Too many instructions
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 248 KB Output is correct
2 Correct 5 ms 256 KB Output is correct
3 Correct 5 ms 256 KB Output is correct
4 Correct 5 ms 256 KB Output is correct
5 Correct 5 ms 256 KB Output is correct
6 Correct 5 ms 256 KB Output is correct
7 Correct 5 ms 296 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 256 KB Output is correct
10 Correct 5 ms 376 KB Output is correct
11 Correct 5 ms 256 KB Output is correct
12 Correct 6 ms 376 KB Output is correct
13 Correct 5 ms 376 KB Output is correct
14 Correct 5 ms 256 KB Output is correct
15 Correct 5 ms 376 KB Output is correct
16 Correct 5 ms 256 KB Output is correct
17 Correct 5 ms 256 KB Output is correct
18 Correct 5 ms 256 KB Output is correct
19 Correct 5 ms 376 KB Output is correct
20 Correct 5 ms 376 KB Output is correct
21 Correct 5 ms 376 KB Output is correct
22 Correct 5 ms 376 KB Output is correct
23 Correct 5 ms 376 KB Output is correct
24 Correct 6 ms 376 KB Output is correct
25 Correct 5 ms 376 KB Output is correct
26 Correct 5 ms 376 KB Output is correct
27 Correct 5 ms 376 KB Output is correct
28 Correct 8 ms 508 KB Output is correct
29 Correct 5 ms 256 KB Output is correct
30 Correct 5 ms 376 KB Output is correct
31 Correct 5 ms 376 KB Output is correct
32 Correct 6 ms 376 KB Output is correct
33 Correct 6 ms 376 KB Output is correct
34 Correct 8 ms 632 KB Output is correct
35 Correct 7 ms 504 KB Output is correct
36 Correct 6 ms 376 KB Output is correct
37 Correct 6 ms 376 KB Output is correct
38 Incorrect 17 ms 3188 KB WA in grader: Too many instructions
39 Halted 0 ms 0 KB -