| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1126036 | nikolashami | Sure Bet (CEOI17_sure) | C++20 | 61 ms | 1864 KiB |
#include <bits/stdc++.h>
using namespace std;
const int N=1e5+4;
double a[N],b[N];
signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
int n;
cin>>n;
for(int i=0;i<n;++i){
cin>>a[i]>>b[i];
}
sort(a,a+n,greater<double>());
sort(b,b+n,greater<double>());
double si=0,sj=0,ans=0;
int i=0,j=0;
for(int k=1;k<=2*n;++k){
if((si<sj||j>=n)&&i<n)si+=a[i++];
else sj+=b[j++];
double x=min(si,sj)-(1.0*k);
ans=max(ans,x);
}
printf("%.4lf",(double)ans);
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
