#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("%lf",ans);
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
9276 KB |
Output is correct |
2 |
Correct |
0 ms |
9276 KB |
Output is correct |
3 |
Correct |
0 ms |
9276 KB |
Output is correct |
4 |
Correct |
0 ms |
9276 KB |
Output is correct |
5 |
Incorrect |
0 ms |
9276 KB |
Output isn't correct |
6 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |