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

#TimeUsernameProblemLanguageResultExecution timeMemory
595639Bench0310Quality Of Living (IOI10_quality)C++17
100 / 100
1641 ms139996 KiB
#include <bits/stdc++.h> #include "quality.h" int rectangle(int n,int m,int h,int w,int a[3001][3001]) { int l=0,r=n*m; int s[n+1][m+1]; memset(s,0,sizeof(s)); while(l<r-1) { int lim=(l+r)/2; for(int i=1;i<=n;i++) for(int j=1;j<=m;j++) s[i][j]=s[i-1][j]+s[i][j-1]-s[i-1][j-1]+(a[i-1][j-1]<=lim); bool ok=0; for(int i=h;i<=n;i++) for(int j=w;j<=m;j++) ok|=(s[i][j]-s[i-h][j]-s[i][j-w]+s[i-h][j-w]>=(h*w+1)/2); if(ok) r=lim; else l=lim; } 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...