Submission #1069570

#TimeUsernameProblemLanguageResultExecution timeMemory
1069570Muhammad_AneeqSoccer Stadium (IOI23_soccer)C++17
0 / 100
1 ms420 KiB
#include <vector> using namespace std; int biggest_stadium(int N, vector<vector<int>> F) { int n=F.size(),m=F[0].size(); for (int i=0;i<n;i++) for (int j=0;j<m;j++) F[i][j]^=1; int pre[n+1][m+1]={}; for (int i=0;i<n;i++) for (int j=0;j<m;j++) pre[i+1][j+1]=pre[i+1][j]+pre[i][j+1]+F[i][j]; for (int i=0;i<n;i++) for (int j=0;j<m;j++) if (F[i][j]==0) { int a=i+1,b=1,c=i+1,d=j+1; if (pre[c][d]-pre[a-1][d]-pre[c][b-1]+pre[a-1][b-1]>0) { a=c,b=d; c=i+1,d=m; if (pre[c][d]-pre[a-1][d]-pre[c][b-1]+pre[a-1][b-1]>0) return 69; } a=1,b=j+1,c=i+1,d=j+1; if (pre[c][d]-pre[a-1][d]-pre[c][b-1]+pre[a-1][b-1]>0) { a=c,b=d; c=n,d=j+1; if (pre[c][d]-pre[a-1][d]-pre[c][b-1]+pre[a-1][b-1]>0) return 69; } } return N*N-F.size(); }
#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...