| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 447441 | fuad27 | Sure Bet (CEOI17_sure) | C++14 | 1 ms | 204 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;
int main () {
int n, A = 0, B = 0;cin>>n;
long double ans = 0.0, sumA = 0.0, sumB = 0.0;
long double a[n], b[n];
for(int i = 0;i<n;i++){
cin>>a[i]>>b[i];
}
sort(a, a+n, greater<long double> ());sort(b, b+n, greater<long double> ());
while(A < n and B < n)
{
if(sumA <= sumB) {
sumA += a[A++];
}
else {
sumB += b[B++];
}
ans = max(ans, min(sumA, sumB) - (long double)(A) - (long double)(B));
}
printf("%.4lf",(double)ans);
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
