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

#TimeUsernameProblemLanguageResultExecution timeMemory
481487QkakeQuality Of Living (IOI10_quality)C++17
100 / 100
1639 ms140148 KiB
#include "quality.h" #include <bits/stdc++.h> using namespace std; const int MX = 3001; bool ok(int level, int R, int C, int r, int c, int Q[MX][MX]) { int sum[MX][MX]; for (int i = 1; i <= R; i++) for (int j = 1; j <= C; j++) sum[i][j] = sum[i][j - 1] + sum[i - 1][j] - sum[i - 1][j - 1] + (Q[i - 1][j - 1] > level ? -1 : 1); for (int i = 1; i + r - 1 <= R; i++) for (int j = 1; j + c - 1 <= C; j++) if (sum[i + r - 1][j + c - 1] - sum[i - 1][j + c - 1] - sum[i + r - 1][j - 1] + sum[i - 1][j - 1] > 0) return true; return false; } int rectangle(int R, int C, int H, int W, int Q[MX][MX]) { int lo = 1, hi = R * C, res = 1; while (lo <= hi) { int mid = lo + (hi - lo) / 2; if (ok(mid, R, C, H, W, Q)) { res = mid; hi = mid - 1; } else lo = mid + 1; } return res; }
#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...