Submission #887240

#TimeUsernameProblemLanguageResultExecution timeMemory
887240Sir_Ahmed_ImranQuality Of Living (IOI10_quality)C++17
0 / 100
1 ms2392 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-1;i<r;i++) for(int j=w-1;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=0;i<r;i++) for(int j=0;j<c;j++) x[i][j]=(q[i][j]<=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...