제출 #587366

#제출 시각아이디문제언어결과실행 시간메모리
587366Omar_Elgedawy삶의 질 (IOI10_quality)C++14
20 / 100
47 ms828 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; for(int i=0;i<r;i++){ for(int j=0;j<c;j++){ s.insert(a[i][j]); } } int ans=*(s.f(s.size()/2)); int op=1; for(int i=0;i<n-r;i++){ if(op){ if(s.size()) ans=min(ans,*s.f(s.size()/2)); for(int j=0;j<m-c;j++){ for(int k=i;k<r+i;k++){ // cout<<k<<' '<<j<<el; s.erase(a[k][j]); } for(int k=i;k<r+i;k++){ // cout<<k<<' '<<j+c<<el; s.insert(a[k][j+c]); } // cout(s); if(s.size()) ans=min(ans,*s.f(s.size()/2)); } for(int j=m-c;j<m;j++){ s.erase(a[i][j]); } for(int j=m-c;j<m;j++){ s.insert(a[i+r][j]); } } else{ if(s.size()) ans=min(ans,*s.f(s.size()/2)); for(int j=m-1;j>=c;j--){ for(int k=i;k<r+i;k++){ // cout<<k<<' '<<j+c<<el; s.insert(a[k][j-c]); } for(int k=i;k<r+i;k++){ // cout<<k<<' '<<j<<el; s.erase(a[k][j]); } // cout<<"D "; // cout(s); if(s.size()) ans=min(ans,*s.f(s.size()/2)); } for(int j=0;j<c;j++){ s.erase(a[i][j]); } for(int j=0;j<c;j++){ s.insert(a[i+r][j]); } } op=!op; } if(s.size()) ans=min(ans,*s.f(s.size()/2)); return ans; }

컴파일 시 표준 에러 (stderr) 메시지

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