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

#TimeUsernameProblemLanguageResultExecution timeMemory
408761rainboyQuality Of Living (IOI10_quality)C11
100 / 100
3687 ms101680 KiB
#include "quality.h" #define N 3000 #define M 3000 int solve(int aa[][3001], int n, int m, int k, int l, int a) { static int aa_[N + 1][M + 1]; int i, j; for (i = 0; i < n; i++) for (j = 0; j < m; j++) aa_[i][j] = aa[i][j] <= a ? 1 : -1; for (i = 0; i < n; i++) for (j = m - 1; j >= 0; j--) aa_[i][j] += aa_[i][j + 1]; for (j = 0; j < m; j++) for (i = n - 1; i >= 0; i--) aa_[i][j] += aa_[i + 1][j]; for (i = 0; i + k <= n; i++) for (j = 0; j + l <= m; j++) if (aa_[i][j] - aa_[i][j + l] - aa_[i + k][j] + aa_[i + k][j + l] > 0) return 1; return 0; } int rectangle(int n, int m, int k, int l, int aa[][3001]) { int lower = 0, upper = n * m; while (upper - lower > 1) { int a = (lower + upper) / 2; if (solve(aa, n, m, k, l, a)) upper = a; else lower = a; } return upper; }
#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...