답안 #995780

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
995780 2024-06-09T22:47:36 Z aaaaaarroz 축구 경기장 (IOI23_soccer) C++17
13.5 / 100
189 ms 31828 KB
#include <bits/stdc++.h>
using namespace std;
bool limites(int N, int i, int j){
	return i>=0&&i<N&&j>=0&&j<N;
}
int biggest_stadium(int N, vector<vector<int>> F){
	if(N>30){
		int empty_cells=0;
		bool posible=true;
		int dx[]={1,0,-1,0};
		int dy[]={0,1,0,-1};
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				if(F[i][j]==0){
					empty_cells++;
				}
				else{
					int grado=0;
					for(int ii=0;ii<4;ii++){
						if(limites(N,i+dx[ii],j+dy[ii])){
							if(F[i+dx[ii]][j+dy[ii]]==0){
								grado++;
							}
						}
					}
					if(grado>=3){
						posible=false;
					}
				}
			}
		}
		return posible==true?empty_cells:1;
	}
	int empty_cells=0;
	pair<int,int>arbol;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if(F[i][j]==0){
				empty_cells++;
			}	
		}
	}
	bool si=true;
	for(int i=0;i<N;i++){
		for(int j=0;j<N;j++){
			if(F[i][j]==1){
				continue;
			}
			priority_queue<tuple<int,int,int>,vector<tuple<int,int,int>>,greater<tuple<int,int,int>>>cola;
			int dx[]={1,0,-1,0};
			int dy[]={0,1,0,-1};
			vector<vector<int>>dist(N,vector<int>(N,INT_MAX));
			dist[i][j]=0;
			cola.push({0,i,j});
			while(!cola.empty()){
				auto[d,x,y]=cola.top();
				cola.pop();
				for(int dir=0;dir<4;dir++){
					int posi=x+dx[dir];
					int posj=y+dy[dir];
					while(true){
						if(!limites(N,posi,posj)||F[posi][posj]==1)break;
						if((d+1)<dist[posi][posj]){
							dist[posi][posj]=d+1;
							cola.push({dist[posi][posj],posi,posj});
						}
						posi+=dx[dir];
						posj+=dy[dir];
					}
				}
			}
			for(int x=0;x<N;x++){
				for(int y=0;y<N;y++){
					if(F[x][y]==0&&(dist[x][y]>=3||dist[x][y]==-1)){
						si=false;
					}
				}
			}
			if(!si){
				break;
			}
		}
		if(!si){
			break;
		}
	}
	if(si){
		return empty_cells;
	}
	else{
		return 1;
	}
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 344 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 1 ms 348 KB ok
4 Correct 2 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 1 ms 348 KB partial
7 Partially correct 1 ms 348 KB partial
8 Partially correct 12 ms 2200 KB partial
9 Partially correct 189 ms 31828 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Partially correct 0 ms 344 KB partial
4 Partially correct 1 ms 348 KB partial
5 Partially correct 0 ms 348 KB partial
6 Partially correct 0 ms 348 KB partial
7 Partially correct 0 ms 348 KB partial
8 Correct 0 ms 348 KB ok
9 Correct 0 ms 348 KB ok
10 Partially correct 0 ms 348 KB partial
11 Partially correct 0 ms 348 KB partial
12 Partially correct 0 ms 348 KB partial
13 Correct 0 ms 348 KB ok
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Partially correct 0 ms 344 KB partial
5 Partially correct 1 ms 348 KB partial
6 Partially correct 0 ms 348 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 0 ms 348 KB partial
9 Correct 0 ms 348 KB ok
10 Correct 0 ms 348 KB ok
11 Partially correct 0 ms 348 KB partial
12 Partially correct 0 ms 348 KB partial
13 Partially correct 0 ms 348 KB partial
14 Correct 0 ms 348 KB ok
15 Partially correct 0 ms 348 KB partial
16 Partially correct 0 ms 348 KB partial
17 Partially correct 0 ms 348 KB partial
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Correct 0 ms 348 KB ok
21 Correct 0 ms 348 KB ok
22 Partially correct 1 ms 348 KB partial
23 Partially correct 0 ms 348 KB partial
24 Partially correct 0 ms 348 KB partial
25 Partially correct 1 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 1 ms 348 KB ok
5 Correct 2 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 1 ms 348 KB partial
8 Partially correct 0 ms 348 KB partial
9 Partially correct 0 ms 348 KB partial
10 Partially correct 0 ms 348 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 0 ms 348 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 0 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Partially correct 0 ms 348 KB partial
21 Partially correct 0 ms 348 KB partial
22 Correct 0 ms 348 KB ok
23 Correct 0 ms 348 KB ok
24 Partially correct 1 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
27 Partially correct 1 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 348 KB partial
30 Partially correct 1 ms 348 KB partial
31 Partially correct 0 ms 348 KB partial
32 Partially correct 0 ms 348 KB partial
33 Partially correct 0 ms 344 KB partial
34 Correct 3 ms 344 KB ok
35 Correct 13 ms 344 KB ok
36 Partially correct 1 ms 348 KB partial
37 Partially correct 1 ms 444 KB partial
38 Partially correct 0 ms 348 KB partial
39 Partially correct 0 ms 348 KB partial
40 Partially correct 1 ms 348 KB partial
41 Partially correct 0 ms 348 KB partial
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 1 ms 348 KB ok
5 Correct 2 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 1 ms 348 KB partial
8 Partially correct 0 ms 348 KB partial
9 Partially correct 0 ms 348 KB partial
10 Partially correct 0 ms 348 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 0 ms 348 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 0 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Partially correct 0 ms 348 KB partial
21 Partially correct 0 ms 348 KB partial
22 Correct 0 ms 348 KB ok
23 Correct 0 ms 348 KB ok
24 Partially correct 1 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
27 Partially correct 1 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 348 KB partial
30 Partially correct 1 ms 348 KB partial
31 Partially correct 0 ms 348 KB partial
32 Partially correct 0 ms 348 KB partial
33 Partially correct 0 ms 344 KB partial
34 Correct 3 ms 344 KB ok
35 Correct 13 ms 344 KB ok
36 Partially correct 1 ms 348 KB partial
37 Partially correct 1 ms 444 KB partial
38 Partially correct 0 ms 348 KB partial
39 Partially correct 0 ms 348 KB partial
40 Partially correct 1 ms 348 KB partial
41 Partially correct 0 ms 348 KB partial
42 Partially correct 12 ms 2208 KB partial
43 Partially correct 13 ms 2196 KB partial
44 Partially correct 12 ms 2396 KB partial
45 Partially correct 12 ms 2200 KB partial
46 Partially correct 12 ms 2392 KB partial
47 Partially correct 12 ms 2200 KB partial
48 Correct 13 ms 2200 KB ok
49 Partially correct 13 ms 2904 KB partial
50 Partially correct 12 ms 2828 KB partial
51 Partially correct 18 ms 2908 KB partial
52 Incorrect 21 ms 2908 KB wrong
53 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 344 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 1 ms 348 KB ok
5 Correct 2 ms 348 KB ok
6 Correct 0 ms 348 KB ok
7 Partially correct 1 ms 348 KB partial
8 Partially correct 1 ms 348 KB partial
9 Partially correct 12 ms 2200 KB partial
10 Partially correct 189 ms 31828 KB partial
11 Partially correct 0 ms 344 KB partial
12 Partially correct 1 ms 348 KB partial
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 0 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Correct 0 ms 348 KB ok
18 Partially correct 0 ms 348 KB partial
19 Partially correct 0 ms 348 KB partial
20 Partially correct 0 ms 348 KB partial
21 Correct 0 ms 348 KB ok
22 Partially correct 0 ms 348 KB partial
23 Partially correct 0 ms 348 KB partial
24 Partially correct 0 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
27 Correct 0 ms 348 KB ok
28 Correct 0 ms 348 KB ok
29 Partially correct 1 ms 348 KB partial
30 Partially correct 0 ms 348 KB partial
31 Partially correct 0 ms 348 KB partial
32 Partially correct 1 ms 348 KB partial
33 Partially correct 0 ms 348 KB partial
34 Partially correct 0 ms 348 KB partial
35 Partially correct 1 ms 348 KB partial
36 Partially correct 0 ms 348 KB partial
37 Partially correct 0 ms 348 KB partial
38 Partially correct 0 ms 344 KB partial
39 Correct 3 ms 344 KB ok
40 Correct 13 ms 344 KB ok
41 Partially correct 1 ms 348 KB partial
42 Partially correct 1 ms 444 KB partial
43 Partially correct 0 ms 348 KB partial
44 Partially correct 0 ms 348 KB partial
45 Partially correct 1 ms 348 KB partial
46 Partially correct 0 ms 348 KB partial
47 Partially correct 12 ms 2208 KB partial
48 Partially correct 13 ms 2196 KB partial
49 Partially correct 12 ms 2396 KB partial
50 Partially correct 12 ms 2200 KB partial
51 Partially correct 12 ms 2392 KB partial
52 Partially correct 12 ms 2200 KB partial
53 Correct 13 ms 2200 KB ok
54 Partially correct 13 ms 2904 KB partial
55 Partially correct 12 ms 2828 KB partial
56 Partially correct 18 ms 2908 KB partial
57 Incorrect 21 ms 2908 KB wrong
58 Halted 0 ms 0 KB -