# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
134472 | 2019-07-22T18:27:39 Z | dragonslayerit | Sure Bet (CEOI17_sure) | C++14 | 78 ms | 3576 KB |
#include <cstdio> #include <algorithm> #include <functional> double as[100005]; double bs[100005]; double all[200005]; int main(){ int N; scanf("%d",&N); for(int i=0;i<N;i++){ scanf("%lf %lf",&as[i],&bs[i]); } std::sort(as,as+N,std::greater<double>()); std::sort(bs,bs+N,std::greater<double>()); int ai=0,bi=0; double again=0,bgain=0; double best=0; while(ai<N||bi<N){ if(bi==N||(ai<N&&again<bgain)){ again+=as[ai++]; }else{ bgain+=bs[bi++]; } best=std::max(best,std::min(again,bgain)-ai-bi); } printf("%.4f\n",best); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 3 ms | 376 KB | Output is correct |
13 | Correct | 3 ms | 376 KB | Output is correct |
14 | Correct | 3 ms | 376 KB | Output is correct |
15 | Correct | 3 ms | 376 KB | Output is correct |
16 | Correct | 3 ms | 376 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 256 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Correct | 2 ms | 376 KB | Output is correct |
7 | Correct | 2 ms | 376 KB | Output is correct |
8 | Correct | 2 ms | 376 KB | Output is correct |
9 | Correct | 2 ms | 376 KB | Output is correct |
10 | Correct | 2 ms | 376 KB | Output is correct |
11 | Correct | 2 ms | 376 KB | Output is correct |
12 | Correct | 3 ms | 376 KB | Output is correct |
13 | Correct | 3 ms | 376 KB | Output is correct |
14 | Correct | 3 ms | 376 KB | Output is correct |
15 | Correct | 3 ms | 376 KB | Output is correct |
16 | Correct | 3 ms | 376 KB | Output is correct |
17 | Correct | 74 ms | 3268 KB | Output is correct |
18 | Correct | 74 ms | 3212 KB | Output is correct |
19 | Correct | 75 ms | 3192 KB | Output is correct |
20 | Correct | 75 ms | 3192 KB | Output is correct |
21 | Correct | 77 ms | 3576 KB | Output is correct |
22 | Correct | 75 ms | 3392 KB | Output is correct |
23 | Correct | 74 ms | 3264 KB | Output is correct |
24 | Correct | 75 ms | 3192 KB | Output is correct |
25 | Correct | 75 ms | 3180 KB | Output is correct |
26 | Correct | 78 ms | 3548 KB | Output is correct |