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

#TimeUsernameProblemLanguageResultExecution timeMemory
595779fuad27Quality Of Living (IOI10_quality)C++17
100 / 100
1601 ms106356 KiB
#include "quality.h" #include<bits/stdc++.h> long long pref[3010][3010]; int rectangle(int R, int C, int H, int W, int Q[3001][3001]) { int lo = -1, hi = R*C; while(hi-lo>1) { int mid = (lo+hi)/2; for(int i = 0;i<R;i++)pref[i][0]=0; for(int i = 0;i<C;i++)pref[0][i]=0; for(int i = 1;i<=R;i++) { for(int j = 1;j<=C;j++) { pref[i][j]=pref[i-1][j]+pref[i][j-1]-pref[i-1][j-1]+(Q[i-1][j-1]<=mid); } } bool check=false; for(int i = H;i<=R;i++) { for(int j = W;j<=C;j++) { if((pref[i][j]-pref[i-H][j]+pref[i-H][j-W]-pref[i][j-W])>(H*W)/2)check=true; } } if(check) { hi=mid; } else { lo=mid; } } return hi; }
#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...