Submission #18479

#TimeUsernameProblemLanguageResultExecution timeMemory
18479eaststar최적의 능력 구성 (kriii3_C)C++14
62 / 62
125 ms9276 KiB
#include <stdio.h> double p[20],d[20],s[1<<20],t,ans; int main(){ int i,j,n,m; scanf("%d",&n); for(i=0;i<n;++i)scanf("%lf%lf",p+i,d+i),p[i]/=100; for(i=0;i<(1<<n);++i){ m=__builtin_popcount(i); for(j=0;j<n;++j)if(!(i&(1<<j)))s[i|(1<<j)]+=(p[j]*d[j]+(1-p[j])*s[i])/(m+1); if(ans<s[i])ans=s[i]; } printf("%.8lf",ans); return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...