Submission #887201

#TimeUsernameProblemLanguageResultExecution timeMemory
887201Muhammad_AneeqQuality Of Living (IOI10_quality)C++17
40 / 100
5021 ms6232 KiB
#pragma GCC optimize("O2") #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #include <set> #include <algorithm> #include <iostream> #include <bits/stdc++.h> using namespace std; int rectangle(int R,int C,int H,int W,int Q[3001][3001]) { ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); int ans=1e9+10; for (int i=0;i<=R-H;i++) { set<int>s; for (int j=i;j<i+H;j++) for (int k=0;k<W;k++) s.insert(Q[j][k]); auto z=end(s); z=prev(z,s.size()/2+1); ans=min(ans,*z); for (int j=W;j<C;j++) { for (int k=i;k<i+H;k++) { s.insert(Q[k][j]); s.erase(Q[k][j-W]); } auto z=end(s); z=prev(z,s.size()/2+1); ans=min(ans,*z); } } return ans; }
#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...