# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
973362 | Captain_Georgia | Sure Bet (CEOI17_sure) | C++17 | 133 ms | 5524 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 TIME = clock();
#define file \
freopen("in.txt" , "r" , stdin); \
freopen("out.txt" , "w" , stdout);
void test_case () {
int n;
cin >> n;
priority_queue<long double> p[2];
for (int i = 0;i < n;i ++) {
long double a , b;
cin >> a >> b;
p[0].push(a);
p[1].push(b);
}
long double res = 0 , d[2] = {0 , 0};
for (int i = 1;i <= n * 2;i ++) {
if (p[0].size() == 0) {
d[1] += p[1].top();
p[1].pop();
} else if (p[1].size() == 0) {
d[0] += p[0].top();
p[0].pop();
} else if (d[0] <= d[1]) {
d[0] += p[0].top();
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |