Submission #1017912

#TimeUsernameProblemLanguageResultExecution timeMemory
1017912socpiteQuality Of Living (IOI10_quality)C++14
100 / 100
1440 ms140080 KiB
#include "quality.h" #include<iostream> using namespace std; const int maxn = 3e3+5; int pfx[maxn][maxn]; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int l = 1, r = R*C; while(l < r){ int mid = (l+r)>>1; bool found = 0; for(int i = 1; i <= R; i++){ for(int j = 1; j <= C; j++){ pfx[i][j] = pfx[i-1][j] + pfx[i][j-1] - pfx[i-1][j-1] + (Q[i-1][j-1] <= mid); if(i >= H && j >= W && pfx[i][j] - pfx[i-H][j] - pfx[i][j-W] + pfx[i-H][j-W] > H*W/2){ found = 1; } } } if(found)r = mid; else l = mid+1; } return l; }
#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...