Submission #1092135

#TimeUsernameProblemLanguageResultExecution timeMemory
1092135ezzzaySure Bet (CEOI17_sure)C++14
20 / 100
1 ms348 KiB
#include<bits/stdc++.h> using namespace std; #define ff first #define ss second #define pb push_back float px[1005],py[1005]; signed main(){ int n; cin>>n; vector<float>a,b; for(int i=0;i<n;i++){ double x,y; cin>>x>>y; a.pb(x); b.pb(y); } sort(a.begin(),a.end(),greater<float>()); sort(b.begin(),b.end(),greater<float>()); for(int i=0;i<n;i++){ px[i+1]=px[i]+a[i]; py[i+1]=py[i]+b[i]; } float ans=0; for(int x=1;x<=n;x++){ for(int y=1;y<=n;y++){ ans=max(ans,min(px[x],py[y])-x-y); } } cout<<fixed<<setprecision(4)<<ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...