제출 #1178098

#제출 시각아이디문제언어결과실행 시간메모리
1178098Kaztaev_Alisher축구 경기장 (IOI23_soccer)C++20
0 / 100
1909 ms2372 KiB
#include <bits/stdc++.h>

#define ios ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define file(s) if (fopen(s".in", "r")) freopen(s".in", "r", stdin), freopen(s".out", "w", stdout)
#define all(a) a.begin() , a.end()
#define F first
#define S second

using namespace std;
using ll = long long;

const ll N = 55 , inf = 2e9 + 7;
const ll INF = 1e18 ,   mod = 1e9+7;

int n , pr[N][N] , a[N][N] , l[N][N], r[N][N] , up[N][N] , dn[N][N] , b[N] , c[N];

int solve(){
	int kol = 0;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			kol += 1-a[i][j];
			for(int i1 = i; i1 <= n; i1++){
				for(int j1 = j; j1 <= n; j1++){
					if(a[i][j] == 0 && a[i1][j1] == 0){
						int c = i , b = j , ok = 1;
						while(c < i1){
							if(a[c][b] == 1) ok = 0;
							c++;
						}
						while(b < j1){
							if(a[c][b] == 1) ok = 0;
							b++;
						}
						c = i , b = j;
						int ok1 = 1;
						while(b < j1){
							if(a[c][b] == 1) ok1 = 0;
							b++;
						}
						while(c < i1){
							if(a[c][b] == 1) ok1 = 0;
							c++;
						}
						if(ok == 0 && ok1 == 0) return 0;
					}
				}
			}
		}
	}
	return kol;
}
int biggest_stadium(int N, vector<vector<int>> F){
	n = N;
	for(int i = 0; i < n; i++){
		for(int j = 0; j < n; j++){
			a[i+1][j+1] =  F[i][j];
		}
	}
	return solve();
}
// int main()
// {
    // int N;
    // assert(1 == scanf("%d", &N));
    // std::vector<std::vector<int>> F(N, std::vector<int>(N));
    // for (int i = 0; i < N; i++)
    // {
        // for (int j = 0; j < N; j++)
        // {
            // assert(1 == scanf("%d", &F[i][j]));
        // }
    // }
    // fclose(stdin);
// 
    // int res = biggest_stadium(N, F);
// 
    // printf("%d\n", res);
    // fclose(stdout);
    // return 0;
// }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...