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

#TimeUsernameProblemLanguageResultExecution timeMemory
531452AdamGSQuality Of Living (IOI10_quality)C++17
100 / 100
2208 ms140320 KiB
#include "quality.h" #include<bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; #define rep(a, b) for(int a = 0; a < (b); ++a) #define st first #define nd second #define pb push_back #define all(a) a.begin(), a.end() const int LIM=3e3+7; int sum[LIM][LIM]; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int p=1, k=R*C; while(p<k) { int sr=(p+k)/2; rep(i, R) rep(j, C) { sum[i+1][j+1]=sum[i+1][j]+sum[i][j+1]-sum[i][j]; if(Q[i][j]<=sr) ++sum[i+1][j+1]; } int ma=0; for(int i=H; i<=R; ++i) for(int j=W; j<=C; ++j) { ma=max(ma, sum[i][j]-sum[i-H][j]-sum[i][j-W]+sum[i-H][j-W]); } if(ma<(H*W+1)/2) p=sr+1; else k=sr; } return p; }
#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...