답안 #15651

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15651 2015-07-14T05:48:17 Z ggoh 최적의 능력 구성 (kriii3_C) C++
62 / 62
102 ms 9276 KB
#include<cstdio>
#include<algorithm>
double all,m,p[22],d[22],D[1<<20];
int a,i,j;
main()
{
	scanf("%d",&a);
	for(i=0;i<a;i++)scanf("%lf%lf",&p[i],&d[i]),p[i]/=100;
	for(i=1;i<(1<<a);i++)
	{
		all=0;
		for(j=0;j<a;j++)
		{
			if((i>>j)%2)
			{
				D[i]+=p[j]*d[j]+(1-p[j])*D[i-(1<<j)];
				all++;
			}
		}
		D[i]/=all;
		m=std::max(m,D[i]);
	}
	printf("%.12lf",m);
} 
# 결과 실행 시간 메모리 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 Correct 0 ms 9276 KB Output is correct
6 Correct 0 ms 9276 KB Output is correct
7 Correct 0 ms 9276 KB Output is correct
8 Correct 0 ms 9276 KB Output is correct
9 Correct 0 ms 9276 KB Output is correct
10 Correct 0 ms 9276 KB Output is correct
11 Correct 0 ms 9276 KB Output is correct
12 Correct 0 ms 9276 KB Output is correct
13 Correct 0 ms 9276 KB Output is correct
14 Correct 0 ms 9276 KB Output is correct
15 Correct 0 ms 9276 KB Output is correct
16 Correct 0 ms 9276 KB Output is correct
17 Correct 0 ms 9276 KB Output is correct
18 Correct 0 ms 9276 KB Output is correct
19 Correct 0 ms 9276 KB Output is correct
20 Correct 0 ms 9276 KB Output is correct
21 Correct 0 ms 9276 KB Output is correct
22 Correct 0 ms 9276 KB Output is correct
23 Correct 0 ms 9276 KB Output is correct
24 Correct 0 ms 9276 KB Output is correct
25 Correct 0 ms 9276 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 95 ms 9276 KB Output is correct
2 Correct 98 ms 9276 KB Output is correct
3 Correct 98 ms 9276 KB Output is correct
4 Correct 94 ms 9276 KB Output is correct
5 Correct 101 ms 9276 KB Output is correct
6 Correct 102 ms 9276 KB Output is correct
7 Correct 94 ms 9276 KB Output is correct
8 Correct 99 ms 9276 KB Output is correct
9 Correct 98 ms 9276 KB Output is correct
10 Correct 101 ms 9276 KB Output is correct
11 Correct 102 ms 9276 KB Output is correct
12 Correct 102 ms 9276 KB Output is correct
13 Correct 102 ms 9276 KB Output is correct
14 Correct 102 ms 9276 KB Output is correct
15 Correct 102 ms 9276 KB Output is correct
16 Correct 102 ms 9276 KB Output is correct
17 Correct 94 ms 9276 KB Output is correct
18 Correct 98 ms 9276 KB Output is correct
19 Correct 98 ms 9276 KB Output is correct
20 Correct 98 ms 9276 KB Output is correct