제출 #1327753

#제출 시각아이디문제언어결과실행 시간메모리
1327753SpyrosAlivSoccer Stadium (IOI23_soccer)C++20
0 / 100
0 ms332 KiB
#include "soccer.h"
#include <bits/stdc++.h>
using namespace std;

int n;
vector<vector<int>> grid;

int biggest_stadium(int N, std::vector<std::vector<int>> F) {
    n = N;
    grid = F;
    if (grid[0][0] || grid[n-1][0] || grid[0][n-1] || grid[n-1][n-1]) {
        return n * n - 1;
    }
    int r = 0, c = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (grid[i][j]) {
                r = i;
                c = j;
            }
        }
    }
    int toL = c, toR = n - c - 1, toU = r, toD = n - r - 1;
    int ans = toL * n + toU * n - toU * toL;
    ans = max(ans, toU * n + toR * n - toU * toR);
    ans = max(ans, toR * n + toD * n - toR * toD);
    ans = max(ans, toD * n + toL * n - toD * toL);
    return ans;
}
#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...