Submission #854647

#TimeUsernameProblemLanguageResultExecution timeMemory
854647abcvuitunggioQuality Of Living (IOI10_quality)C++17
100 / 100
1382 ms140264 KiB
#include "quality.h" #include <iostream> int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int l=1,r=R*C,kq=0,S[R][C]; while (l<=r){ int mid=(l+r)>>1,ch=0; for (int i=0;i<R;i++) for (int j=0;j<C;j++){ S[i][j]=(i?S[i-1][j]:0)+(j?S[i][j-1]:0)-(i&&j?S[i-1][j-1]:0)+(Q[i][j]<mid)-(Q[i][j]>mid); if (i>=H-1&&j>=W-1&&S[i][j]-(i<H?0:S[i-H][j])-(j<W?0:S[i][j-W])+(i<H||j<W?0:S[i-H][j-W])>=0) ch=1; } if (ch){ kq=mid; r=mid-1; } else l=mid+1; } return kq; }
#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...