#include "soccer.h"
using namespace std;
#define pb push_back
#define mp make_pair
// (y,x)
int biggest_stadium(int n, vector<vector<int>> f){
pair<int, int> tree = mp(-1,-1);
for(int y=0; y<n; y++){
for(int x=0; x<n; x++){
if(f[y][x]){
tree = mp(y,x);
}
}
}
if(tree.first==-1){
return n*n;
}
int dy,dx;
dy = min(tree.first, n-1-tree.first)+1;
dx = min(tree.second, n-1-tree.second)+1;
return n*n - min(dy,dx)*min(dy,dx);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |