Submission #1011061

#TimeUsernameProblemLanguageResultExecution timeMemory
1011061Dan4LifeSoccer Stadium (IOI23_soccer)C++17
0 / 100
4598 ms492 KiB
#include "soccer.h" #include <bits/stdc++.h> using namespace std; #define pb push_back #define sz(a) (int)a.size() #define all(a) begin(a),end(a) const int mxN = (int)1e3+10; int n; set<int> col[mxN]; int biggest_stadium(int N, vector<vector<int>> F) { n = N; int ans = 0; for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(!F[i][j]) continue; col[j].insert(i); } col[i].insert(-1),col[i].insert(n); } for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ if(F[i][j]) continue; int k = i; while(k<n){ if(F[k][j]) break; for(int l = i; l <= k; l++){ int U = i, D = k; int tot = D-U+1; for(int m = j-1; m>=0; m--){ auto itr2 = col[m].lower_bound(l); auto itr = itr2; itr--; U = max(U,*itr+1); D = min(D,*itr2-1); if(U>l or D<l) break; tot+=D-U+1; } U = i, D = k; for(int m = j+1; m < n; m++){ auto itr2 = col[m].lower_bound(l); auto itr = itr2; itr--; U = max(U,*itr+1); D = min(D,*itr2-1); if(U>l or D<l) break; tot+=D-U+1; } ans = max(ans, tot); } k++; } } } 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...