(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 #466250

#TimeUsernameProblemLanguageResultExecution timeMemory
466250surguttiQuality Of Living (IOI10_quality)C++14
100 / 100
2005 ms140248 KiB
#include "quality.h" #include <bits/stdc++.h> using namespace std; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int l = 0, r = R * C + 1; static int c[3001][3001]; for(int i = 0; i <= R; i++) { for(int j = 0; j <= C; j++) { c[i][j] = 0; } } while(r - l > 1) { int m = (l + r) >> 1; for(int i = R - 1; i >= 0; i--) { for(int j = C - 1; j >= 0; j--) { c[i][j] = c[i + 1][j] + c[i][j + 1] - c[i + 1][j + 1] + (Q[i][j] <= m); } } bool ok = true; for(int i = 0; i <= R - H; i++) { for(int j = 0; j <= C - W; j++) { if(c[i][j] - c[i + H][j] - c[i][j + W] + c[i + H][j + W] >= (H * W + 1) / 2) { ok = false; } } } if(ok) l = m; else r = m; } return r; }
#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...