This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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 time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |