Submission #1007123

#TimeUsernameProblemLanguageResultExecution timeMemory
1007123De3b0oSoccer Stadium (IOI23_soccer)C++17
8 / 100
4567 ms408 KiB
#include "soccer.h" #include<bits/stdc++.h> #include<random> #define ll long long #define F first #define S second #define in insert #define pb push_back #define ppb pop_back() #define d3 ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define cans cout << ans << "\n"; #define yes cout << "Yes" << "\n"; #define no cout << "No" << "\n"; #define pll pair<ll,ll> #define lin cout << "\n"; #define sqr 340 #define mod 1000000007 #define mid ((l+r)/2) #define lc (2*n) #define rc (2*n+1) using namespace std; ll n; int biggest_stadium(int N, std::vector<std::vector<int>> F) { n=N; ll w = (1<<(n*n)); ll ans = 0; for(int h = 0 ; w>h ; h++) { ll g[n][n]; ll b = 1; ll sz=0; for(int i = 0 ; n>i ; i++) { for(int j = 0 ; n>j ; j++) { g[i][j]= (h&b); b*=2; } } bool nt = 0; for(int i = 0 ; n>i ; i++) { for(int j = 0 ; n>j ; j++) { if(F[i][j]&&g[i][j]) nt=1; if(g[i][j]) sz++; } } if(nt) continue; bool gt = 1; for(int i = 0 ; n>i ; i++) { for(int j = 0 ; n>j ; j++) { for(int i1 = 0 ; n>i1 ; i1++) { for(int j1 = 0 ; n>j1 ; j1++) { if(!g[i][j]||!g[i1][j1]) continue; bool l1 = 1 , r1 = 1 , l2 = 1 , r2 = 1; for(int d = min(i,i1) ; max(i,i1)>=d ; d++) { if(g[d][j]==0) l1=0; if(g[d][j1]==0) l2=0; } for(int d = min(j,j1) ; max(j,j1)>=d ; d++) { if(g[i1][d]==0) r1=0; if(g[i][d]==0) r2=0; } if((!(l1&&r1))&&(!(l2&&r2))) gt=0; } } } } if(gt) ans=max(ans,sz); } 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...