Submission #15651

#TimeUsernameProblemLanguageResultExecution timeMemory
15651ggoh최적의 능력 구성 (kriii3_C)C++98
62 / 62
102 ms9276 KiB
#include<cstdio> #include<algorithm> double all,m,p[22],d[22],D[1<<20]; int a,i,j; main() { scanf("%d",&a); for(i=0;i<a;i++)scanf("%lf%lf",&p[i],&d[i]),p[i]/=100; for(i=1;i<(1<<a);i++) { all=0; for(j=0;j<a;j++) { if((i>>j)%2) { D[i]+=p[j]*d[j]+(1-p[j])*D[i-(1<<j)]; all++; } } D[i]/=all; m=std::max(m,D[i]); } printf("%.12lf",m); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...