| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 52672 | snat123 | Sure Bet (CEOI17_sure) | C++14 | 3 ms | 620 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
double a[100001], b[100001];
int main(){
int n;
cin >> n;
for(int i=0; i<n; i++) cin >> a[i] >> b[i];
sort(a, a+n+1);
sort(b, b+n+1);
int i=n, j=n;
double x=0.0, y=0.0, res=0.0;
while(i>=0 || j>=0){
if(i<0 || x>y) y+=b[j--];
else x+=a[i--];
//x-=1;
//y-=1;
res=max(res, min(x, y)-(n-i)-(n-j));
}
printf("%.4lf", res);
return 0;
} | # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
