# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
115062 | 2019-06-05T04:00:39 Z | IOrtroiii | Sure Bet (CEOI17_sure) | C++14 | 94 ms | 3812 KB |
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); priority_queue<double> qa; priority_queue<double> qb; for (int i = 1; i <= n; ++i) { double a, b; scanf("%lf %lf", &a, &b); qa.emplace(a); qb.emplace(b); } double sa = 0.0; double sb = 0.0; double ans = 0.0; for (int i = 1; i <= 2 * n; ++i) { if (sa < sb) { if (qa.empty()) break; sa += qa.top(); qa.pop(); } else { if (qb.empty()) break; sb += qb.top(); qb.pop(); } ans = max(ans, min(sa, sb) - 1.0 * i); } cout << fixed << setprecision(4) << ans << endl; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 3 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Correct | 3 ms | 384 KB | Output is correct |
15 | Correct | 3 ms | 384 KB | Output is correct |
16 | Correct | 3 ms | 384 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 2 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 256 KB | Output is correct |
6 | Correct | 2 ms | 256 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 256 KB | Output is correct |
9 | Correct | 2 ms | 256 KB | Output is correct |
10 | Correct | 2 ms | 256 KB | Output is correct |
11 | Correct | 2 ms | 256 KB | Output is correct |
12 | Correct | 3 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Correct | 3 ms | 384 KB | Output is correct |
15 | Correct | 3 ms | 384 KB | Output is correct |
16 | Correct | 3 ms | 384 KB | Output is correct |
17 | Correct | 82 ms | 3556 KB | Output is correct |
18 | Correct | 79 ms | 3516 KB | Output is correct |
19 | Correct | 80 ms | 3528 KB | Output is correct |
20 | Correct | 76 ms | 3428 KB | Output is correct |
21 | Correct | 83 ms | 3808 KB | Output is correct |
22 | Correct | 85 ms | 3296 KB | Output is correct |
23 | Correct | 82 ms | 3552 KB | Output is correct |
24 | Correct | 80 ms | 3428 KB | Output is correct |
25 | Correct | 76 ms | 3424 KB | Output is correct |
26 | Correct | 94 ms | 3812 KB | Output is correct |