# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
879396 | 2023-11-27T09:53:21 Z | vjudge1 | Sure Bet (CEOI17_sure) | C++17 | 79 ms | 4000 KB |
/* ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠟⠛⠛⠛⠛⠛⠿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠛⠉⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠙⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣴⠞⢛⣛⠻⣷⡄⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣴⣿⢡⣾⣿⣿⣷⢹⡇⠋⠉⠀⢀⣀⣀⣀⠉⠙⢿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⢠⣴⣶⣶⣤⠀⠀⠀⠀⣿⣷⣜⠿⠿⠟⣡⠟⠁⢀⡠⠂⠉⠀⠀⠀⠉⠐⡄⠹⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠟⠁⠀⠻⢷⡿⠟⠁⢀⣾⡄⠀⠛⠿⢿⠷⠶⠚⣋⠠⠒⠉⠣⡀⠀⠀⠀⠀⠀⠀⡇⠀⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠰⠅⠀⠄⠀⠀⠀⠀⠀⠊⠀⠈⠀⠀⣀⠠⠤⠒⠉⠀⠀⠀⠀⠀⠙⠄⠀⠀⠀⠀⠀⠃⢠⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃⠀⠁⠀⠀⠀⠊⠉⠓⠒⠒⠒⠚⠋⠉⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⠳⡀⠀⢀⠄⣠⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠢⡀⢠⠆⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⠰⠆⣀⠴⣿⣿⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⠤⢀⠈⠺⢄⡀⠀⠀⠀⠀⠀⠀⠀⠀⠈⡆⠀⠀⠀⠀⠀⠀⣀⣀⠠⠄⠊⣁⠄⠀⠁⠀⠀⣻⣛⠛⢛⣉ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣇⠀⠀⠉⠂⠀⠈⠙⢒⠒⠒⠒⠂⠀⠀⠀⠐⠀⠀⠒⠒⠊⢉⡀⠀⠀⠐⠈⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿ ⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⣸⣿⡀⠀⠀⠀⠀⠀⠀⠁⠢⣀⣀⣀⣀⣀⣀⣠⣤⢴⠊⠉⠉⠀⠀⠀⠀⠀⠀⢀⣀⣠⣴⠻⠿⠿⠿⠿⠿ ⣿⣿⡿⠿⠿⢿⣿⡿⢟⣩⣶⣿⣿⣿⢷⣀⠀⠀⠀⠀⠀⠀⠰⣈⠻⣿⡿⠟⠋⠡⠇⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⡜⣿⣿⣶⣶⣶⣶ ⢋⣴⣶⣶⣶⣶⣶⣾⣿⣿⣿⣿⣿⠏⣼⣿⣿⣤⣤⠀⠀⠀⠀⠘⠀⠤⠤⠔⢂⠂⣀⣀⣀⣀⣀⣤⣾⣿⣿⣿⣿⣿⣿⣷⣌⠻⣿⣿⣿⣿ ⠛⢿⣿⠿⠿⢿⣿⣿⣿⣿⣿⣿⠟⣸⣿⣿⣿⣿⣿⣤⣴⣆⣀⣰⠀⠀⠀⠀⠱⡀⢹⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣦⣙⠻⣿ */ #include<bits/stdc++.h> using namespace std; #define ll long long int #define lld long long double #define pb push_back #define pf push_front #define all(a) a.begin(),a.end() #define IShowSpeed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); const int N=5e5+10; const int mod=1e9+7; vector<double>v1,v2; int main() { IShowSpeed int n,x1,y1; cin>>n; for(int i=1;i<=n;i++) { double x,y; cin>>x>>y; v1.pb(x); v2.pb(y); } sort(all(v1)); sort(all(v2)); reverse(all(v1)); reverse(all(v2)); for(int i=1;i<v1.size();i++) v1[i]+=v1[i-1]; for(int i=1;i<v2.size();i++) v2[i]+=v2[i-1]; double ans=0; int l=0,r=0; ans=max(ans,min(v1[l],v2[r])-(l+r+2)); while(l+1<n || r+1<n) { if(r==n-1 || (l+1<n && min(v1[l+1],v2[r])>=min(v1[l],v2[r+1]))) l++; else r++; ans=max(ans,min(v1[l],v2[r])-(l+r+2)); } cout<<fixed<<setprecision(4)<<ans; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 456 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 456 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 604 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
13 | Correct | 1 ms | 348 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
15 | Correct | 1 ms | 468 KB | Output is correct |
16 | Correct | 1 ms | 348 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 348 KB | Output is correct |
2 | Correct | 1 ms | 348 KB | Output is correct |
3 | Correct | 0 ms | 456 KB | Output is correct |
4 | Correct | 1 ms | 348 KB | Output is correct |
5 | Correct | 0 ms | 344 KB | Output is correct |
6 | Correct | 0 ms | 348 KB | Output is correct |
7 | Correct | 0 ms | 348 KB | Output is correct |
8 | Correct | 0 ms | 348 KB | Output is correct |
9 | Correct | 0 ms | 604 KB | Output is correct |
10 | Correct | 0 ms | 348 KB | Output is correct |
11 | Correct | 0 ms | 348 KB | Output is correct |
12 | Correct | 1 ms | 348 KB | Output is correct |
13 | Correct | 1 ms | 348 KB | Output is correct |
14 | Correct | 1 ms | 348 KB | Output is correct |
15 | Correct | 1 ms | 468 KB | Output is correct |
16 | Correct | 1 ms | 348 KB | Output is correct |
17 | Correct | 71 ms | 3568 KB | Output is correct |
18 | Correct | 59 ms | 3544 KB | Output is correct |
19 | Correct | 59 ms | 3400 KB | Output is correct |
20 | Correct | 59 ms | 3412 KB | Output is correct |
21 | Correct | 62 ms | 4000 KB | Output is correct |
22 | Correct | 59 ms | 3516 KB | Output is correct |
23 | Correct | 58 ms | 3416 KB | Output is correct |
24 | Correct | 59 ms | 3516 KB | Output is correct |
25 | Correct | 58 ms | 3552 KB | Output is correct |
26 | Correct | 79 ms | 3856 KB | Output is correct |