#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 ans = 0;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; 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;
while(c < i1){
if(a[c][b] == 0) return 0;
c++;
}
while(b < j1){
if(a[c][b] == 0) return 0;
b++;
}
}
}
}
}
}
return 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;
// }
# | 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... |