This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "bits/stdc++.h"
#include "soccer.h"
#define FOR(i, begin, end) for(int i=(begin); i<(end); i++)
#define pb push_back
using namespace std;
typedef vector<int> vi;
const int N=3e3+10;
int n, f[N][N];
int biggest_stadium(int N, std::vector<std::vector<int>> F) {
n=N; FOR(i, 0, n) FOR(j, 0, n) f[i][j]=F[i][j];
int ans=-1;
FOR(i, 0, n) {
FOR(j, 0, n) {
if(f[i][j]) {
ans=max(ans, n*n-1-(n-1-i)-(n-1-j));
ans=max(ans, n*n-1-i-(n-1-j));
ans=max(ans, n*n-1-j-(n-1-i));
ans=max(ans, n*n-1-i-j);
}
}
}
return ans==-1?n*n:ans;
}
/*
5
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 0 0 0 0
0 1 0 0 0
0 0
0 0
*/
# | 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... |