답안 #1065450

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1065450 2024-08-19T07:45:08 Z ReLice 축구 경기장 (IOI23_soccer) C++17
12 / 100
4500 ms 5084 KB
#include "soccer.h"
#include <bits/stdc++.h>
#define ll int
#define pb push_back
#define ins insert
#define fr first
#define sc second
#define vll vector<ll>
#define sz size()
using namespace std;

const ll N = 7;
const ll M = N * N + 7;
const ll inf = 1e9 + 7;
vector<vll> f;
ll n;

bool ok(ll x,ll y){
	return x>=0 && x<n && y>=0 && y<n && !f[x][y];
}

bool can(ll x,ll y,ll x2,ll y2){
	ll a = 0;
	ll b = 0;
	ll xx = x;
	while(x != x2){
		a += f[x][y];
		b += f[x][y2];
		
		if(x < x2) x++;
		else x--;
	}
	x = xx;
	while(y != y2){
		a += f[x2][y];
		b += f[x][y];
		
		if(y < y2) y++;
		else y--;
	}
	if(min(a, b) == 0) return true;
	return false;
}

bool check(vll v){
	for(auto i : v){
		for(auto j : v){
			if(i == j)continue;
			ll x = i / n, y = i % n;
			
			ll x2 = j / n, y2 = j % n;
			
			if(!can(x, y, x2, y2)) return false;
		}
	}
	return true;
}
int biggest_stadium(int nn, vector<vector<int>> F){
	ll i,j;
	
	n = nn;
	f = F;
	
	vll v;
	for(i=0;i<n;i++){
		for(auto j : f[i])v.pb(j);
	}
	
	ll sum = 0;
	
	bool f = 1;
	for(i=0;i<n*n;i++){
		sum += v[i];
		
		for(j=i+1;j<n*n;j++){
			if(v[i] || v[j])continue;
			
			if(!check({i,j})) f = 0;
		}
	}
	
	if (f) return n * n - sum;
	return 1;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB partial
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB ok
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 0 ms 432 KB partial
7 Execution timed out 4570 ms 604 KB Time limit exceeded
8 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 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 0 ms 344 KB partial
5 Partially correct 0 ms 348 KB partial
6 Partially correct 0 ms 348 KB partial
7 Partially correct 0 ms 344 KB partial
8 Correct 0 ms 348 KB ok
9 Correct 1 ms 344 KB ok
10 Partially correct 0 ms 348 KB partial
11 Partially correct 0 ms 348 KB partial
12 Partially correct 1 ms 348 KB partial
13 Correct 0 ms 348 KB ok
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 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 0 ms 344 KB partial
6 Partially correct 0 ms 348 KB partial
7 Partially correct 0 ms 348 KB partial
8 Partially correct 0 ms 344 KB partial
9 Correct 0 ms 348 KB ok
10 Correct 1 ms 344 KB ok
11 Partially correct 0 ms 348 KB partial
12 Partially correct 0 ms 348 KB partial
13 Partially correct 1 ms 348 KB partial
14 Correct 0 ms 348 KB ok
15 Partially correct 0 ms 348 KB partial
16 Partially correct 1 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 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
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 344 KB partial
8 Partially correct 0 ms 348 KB partial
9 Partially correct 0 ms 348 KB partial
10 Partially correct 0 ms 344 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 1 ms 344 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 1 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 1 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 0 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
27 Partially correct 0 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 348 KB partial
30 Partially correct 18 ms 348 KB partial
31 Partially correct 17 ms 600 KB partial
32 Partially correct 7 ms 348 KB partial
33 Partially correct 1 ms 348 KB partial
34 Correct 1 ms 348 KB ok
35 Correct 2 ms 348 KB ok
36 Partially correct 2 ms 348 KB partial
37 Partially correct 1 ms 344 KB partial
38 Partially correct 1 ms 348 KB partial
39 Partially correct 2 ms 352 KB partial
40 Partially correct 11 ms 348 KB partial
41 Partially correct 23 ms 428 KB partial
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Partially correct 0 ms 344 KB partial
7 Partially correct 0 ms 344 KB partial
8 Partially correct 0 ms 348 KB partial
9 Partially correct 0 ms 348 KB partial
10 Partially correct 0 ms 344 KB partial
11 Correct 0 ms 348 KB ok
12 Correct 1 ms 344 KB ok
13 Partially correct 0 ms 348 KB partial
14 Partially correct 0 ms 348 KB partial
15 Partially correct 1 ms 348 KB partial
16 Correct 0 ms 348 KB ok
17 Partially correct 0 ms 348 KB partial
18 Partially correct 1 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 0 ms 348 KB partial
25 Partially correct 0 ms 348 KB partial
26 Partially correct 0 ms 348 KB partial
27 Partially correct 0 ms 348 KB partial
28 Partially correct 0 ms 348 KB partial
29 Partially correct 0 ms 348 KB partial
30 Partially correct 18 ms 348 KB partial
31 Partially correct 17 ms 600 KB partial
32 Partially correct 7 ms 348 KB partial
33 Partially correct 1 ms 348 KB partial
34 Correct 1 ms 348 KB ok
35 Correct 2 ms 348 KB ok
36 Partially correct 2 ms 348 KB partial
37 Partially correct 1 ms 344 KB partial
38 Partially correct 1 ms 348 KB partial
39 Partially correct 2 ms 352 KB partial
40 Partially correct 11 ms 348 KB partial
41 Partially correct 23 ms 428 KB partial
42 Execution timed out 4548 ms 5084 KB Time limit exceeded
43 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Partially correct 0 ms 348 KB partial
2 Correct 0 ms 348 KB ok
3 Correct 0 ms 348 KB ok
4 Correct 0 ms 348 KB ok
5 Correct 0 ms 348 KB ok
6 Correct 0 ms 348 KB ok
7 Partially correct 0 ms 432 KB partial
8 Execution timed out 4570 ms 604 KB Time limit exceeded
9 Halted 0 ms 0 KB -