Submission #587388

#TimeUsernameProblemLanguageResultExecution timeMemory
587388Omar_ElgedawyQuality Of Living (IOI10_quality)C++14
20 / 100
59 ms936 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)); } } if(s.size()) ans=min(ans,*s.f(s.size()/2)); return ans; }

Compilation message (stderr)

quality.cpp: In function 'int rectangle(int, int, int, int, int (*)[3001])':
quality.cpp:44:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   44 |     if(s.size())
      |     ^~
quality.cpp:46:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   46 |  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...