Submission #887243

#TimeUsernameProblemLanguageResultExecution timeMemory
887243Sir_Ahmed_ImranQuality Of Living (IOI10_quality)C++17
0 / 100
1 ms2396 KiB
///~~~LOTA~~~/// #include "quality.h" #include <bits/stdc++.h> using namespace std; int x[3001][3001]; bool check(int r,int c,int h,int w){ for(int i=h;i<=r;i++) for(int j=w;j<=c;j++) if((x[i][j]-x[i-h][j]-x[i][j-w]+x[i-h][j-w])>=(h*w+1)/2) return 1; return 0; } int rectangle(int r,int c,int h,int w,int q[3001][3001]){ int o=log2(r*c); o=pow(2,o); int ans=0; for(o=o;o>0;o/=2){ if(ans+o>r*c) continue; for(int i=1;i<=r;i++) for(int j=1;j<=c;j++) x[i][j]=(q[i-1][j-1]<=ans+o)+x[i-1][j]+x[i][j-1]-x[i-1][j-1]; if(check(r,c,h,w)) ans+=o; } 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...