제출 #1178120

#제출 시각아이디문제언어결과실행 시간메모리
1178120Kaztaev_AlisherSoccer Stadium (IOI23_soccer)C++20
6 / 100
210 ms63952 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 = 2055 , inf = 2e9 + 7;
const ll INF = 1e18 ,   mod = 1e9+7;

int n , pr[N][N] , a[N][N];

int solve(){
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			pr[i][j] = a[i][j] + pr[i-1][j] + pr[i][j-1] - pr[i-1][j-1];
		}
	}
	if(pr[n][n] == 0) return n*n;
	for(int i = 1; i <= n; i++){
		for(int j = 1; j <= n; j++){
			if(a[i][j] == 1){
				return n*n-min({i*j,i*(n-j+1),(n-i+1)*j , (n-i+1)*(n-j+1)});
			}
		}
	}
}
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;
// }

컴파일 시 표준 에러 (stderr) 메시지

soccer.cpp: In function 'int solve()':
soccer.cpp:31:1: warning: control reaches end of non-void function [-Wreturn-type]
   31 | }
      | ^
#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...