제출 #587393

#제출 시각아이디문제언어결과실행 시간메모리
587393Omar_Elgedawy삶의 질 (IOI10_quality)C++14
20 / 100
60 ms852 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> using namespace __gnu_pbds; #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> //#include "grader.cpp" #include "quality.h" using namespace std; #define cin(vec) for(auto& i : vec) cin >> i #define cout(vec) for(auto& i : vec) cout << i << " "; cout << "\n"; #define fast ios::sync_with_stdio(0);cin.tie(0); #define loop(i,a,b) for (int i = a; i < b; i++) #define F first #define S second #define pb(n) push_back(n) #define pf(n) push_front(n) #define dci(d) fixed<<setprecision(d) #define sp ' ' #define el '\n' #define all(v) v.begin(),v.end() #define f find_by_order int rectangle(int n, int m, int r, int c, int a[3001][3001]) { ordered_set s; int ans=1e9; for(int i=0;i<n-r;i++){ s.clear(); for(int k=i;k<i+r;k++){ for(int j=0;j<c;j++){ s.insert(a[k][j]); } } ans=min(ans,*s.f(s.size()/2)); for(int j=0;j<m-c;j++){ for(int k=i;k<r+i;k++){ s.erase(a[k][j]); } for(int k=i;k<r+i;k++){ s.insert(a[k][j+c]); } ans=min(ans,*s.f(s.size()/2)); } } 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...