(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #684445

#TimeUsernameProblemLanguageResultExecution timeMemory
684445onlk97Quality Of Living (IOI10_quality)C++14
100 / 100
1670 ms140148 KiB
#include <bits/stdc++.h> #include "quality.h" using namespace std; int rectangle(int R, int C, int H, int W, int Q[3001][3001]){ int l=1,r=R*C; int ps[R+1][C+1]; while (l<r){ int mid=(l+r)/2; for (int i=0; i<=R; i++){ for (int j=0; j<=C; j++) ps[i][j]=0; } for (int i=1; i<=R; i++){ for (int j=1; j<=C; j++){ ps[i][j]=ps[i-1][j]+ps[i][j-1]-ps[i-1][j-1]+(Q[i-1][j-1]<=mid); } } bool ok=0; for (int i=H; i<=R; i++){ for (int j=W; j<=C; j++){ if (ps[i][j]-ps[i-H][j]-ps[i][j-W]+ps[i-H][j-W]>=(H*W+1)/2) ok=1; } } if (ok) 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...