Submission #15310

#TimeUsernameProblemLanguageResultExecution timeMemory
15310gs13068최적의 능력 구성 (kriii3_C)C++98
62 / 62
100 ms9764 KiB
#include<cstdio> #include<algorithm> double d[1111111]; double p[22],q[22]; int main() { double max=0; int i,j,t,n; scanf("%d",&n); for(i=0;i<n;i++) { scanf("%lf%lf",&p[i],&q[i]); p[i]/=100; } for(i=1;i<(1<<n);i++) { t=0; for(j=0;j<n;j++)if((i>>j)&1) { t++; d[i]+=p[j]*q[j]+(1-p[j])*d[i^(1<<j)]; } d[i]/=t; max=std::max(max,d[i]); } printf("%.12lf\n",max); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...