# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1059129 | hasan2006 | Soccer Stadium (IOI23_soccer) | C++17 | 0 ms | 0 KiB |
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"
using namespace std;
#define TL ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define rall(s) s.rbegin(),s.rend()
#define all(s) s.begin(),s.end()
#define pb push_back
#define se second
#define fi first
#define ll long long
#define ld long double
#define YES cout<<"YES\n"
#define Yes cout<<"Yes\n"
#define yes cout<<"yes\n"
#define NO cout<<"NO\n"
#define No cout<<"No\n"
#define no cout<<"no\n"
const int N = 5e5 + 9 , mod = 1e9 + 7;
ll a[N] , b[N] , dp[N] , c[N] , d[N];
int biggest_stadium(int n , vector<vector<int>>a) {
ll i , j , l, r , s = 0 , f = 0 , x , y , k , m ;
for(i = 0; i < n; i++) {
s = 0;
for(j = 0; j < n; j++) {
f += 1 - a[i][j];
if(a[i][j] == 0 && s == 0)
s = 1;
else if(a[i][j] == 1 && s == 1)
s = 2;
else if(a[i][j] == 0 && s == 2)
s = -1;
}
if(s == -1)
return n * n + 1;
}
for(i = 0; i < n; i++) {
s = 0;
for(j = 0; j < n; j++) {
if(a[j][i] == 0 && s == 0)
s = 1;
else if(a[j][i] == 1 && s == 1)
s = 2;
else if(a[j][i] == 0 && s == 2)
s = -1;
}
if(s == -1)
return n * n + 1;
}
return f;
}
int main() {
cout<<biggest_stadium(3 , {{1 , 0 , 0} , {0 , 1 , 0} , {0 , 0 , 0}})<<"\n";
}