Submission #18477

# Submission time Handle Problem Language Result Execution time Memory
18477 2016-02-05T15:01:39 Z eaststar 최적의 능력 구성 (kriii3_C) C++14
0 / 62
0 ms 9276 KB
#include <stdio.h>
double p[20],s[1<<20],t,ans;
int d[20];
int main(){
    int i,j,n,m;
    scanf("%d",&n);
    for(i=0;i<n;++i)scanf("%lf%d",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;
}
# Verdict Execution time Memory 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 -
# Verdict Execution time Memory Grader output
1 Halted 0 ms 0 KB -