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

#TimeUsernameProblemLanguageResultExecution timeMemory
800929GoldLightQuality Of Living (IOI10_quality)C++17
100 / 100
983 ms70888 KiB
#include <bits/stdc++.h> using namespace std; void fast(){ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout.tie(0);} const int N=3e3; int pref[N+1][N+1]; int rectangle(int r, int c, int h, int w, int q[3001][3001]){ fast(); int n=r*c, m=h*w; int ans=n, ki=1, ka=n; while(ki<=ka){ int mid=(ki+ka)/2; bool cek=false; //count qij<=mid for(int i=0; i<r; i++){ for(int j=0; j<c; j++){ pref[i+1][j+1]=(q[i][j]<=mid)+pref[i][j+1]+pref[i+1][j]-pref[i][j]; if(i>=h-1 && j>=w-1 && pref[i+1][j+1]-pref[i-h+1][j+1]-pref[i+1][j-w+1]+pref[i-h+1][j-w+1]>=m/2+1){ cek=true; break; } } } if(cek){ ans=mid; ka=mid-1; } else ki=mid+1; } return ans; } // int main(){ // int r, c, h, w; cin>>r>>c>>h>>w; // for(int i=0; i<r; i++){ // for(int j=0; j<c; j++){ // cin>>q[i][j]; // } // } // cout<<rectangle(r, c, h, w); // }
#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...