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

#TimeUsernameProblemLanguageResultExecution timeMemory
310121TemmieQuality Of Living (IOI10_quality)C++17
100 / 100
2017 ms70956 KiB
#include "quality.h" #include <bits/stdc++.h> bool f(int r, int c, int h, int w, int q[3001][3001], int mid) { int g[3001][3001]; for (int i = 0; i <= r; i++) for (int j = 0; j <= c; j++) g[i][j] = 0; for (int i = 0; i < r; i++) for (int j = 0; j < c; j++) g[i + 1][j + 1] = g[i][j + 1] + g[i + 1][j] - g[i][j] + (q[i][j] <= mid); for (int i = h; i <= r; i++) for (int j = w; j <= c; j++) if (g[i][j] - g[i - h][j] - g[i][j - w] + g[i - h][j - w] > h * w / 2) return true; return false; } int rectangle(int r, int c, int h, int w, int q[3001][3001]) { int L = 0, R = r * c; while (R - L - 1) { int mid = (L + R) >> 1; if (f(r, c, h, w, q, mid)) R = mid; else L = mid; } 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...