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

#TimeUsernameProblemLanguageResultExecution timeMemory
538739joshualiu555Quality Of Living (IOI10_quality)C++17
100 / 100
1956 ms83868 KiB
#include "grader.h" #include <bits/stdc++.h> using namespace std; #define FOR(i, x, n) for (int i = x; i <= n; i++) #define mem(a, x) memset(a, x, sizeof(a)) bool check(int R, int C, int H, int W, int Q[3001][3001], int median) { int ps[3001][3001]; mem(ps, 0); FOR(i, 1, R) { FOR(j, 1, C) { if (Q[i - 1][j - 1] <= median) { ps[i][j] = 1; } else { ps[i][j] = -1; } } } FOR(i, 1, R) { FOR(j, 1, C) { ps[i][j] += ps[i][j - 1] + ps[i - 1][j] - ps[i - 1][j - 1]; } } FOR(i, H, R) { FOR(j, W, C) { if (ps[i][j] - ps[i - H][j] - ps[i][j - W] + ps[i - H][j - W] > 0) { return true; } } } return false; } int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int ans = -1; int l = 1, r = R * C; while (l <= r) { int m = (l + r) / 2; if (check(R, C, H, W, Q, m)) { ans = m; r = m - 1; } else { l = m + 1; } } return ans; }
#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...