Submission #15197

# Submission time Handle Problem Language Result Execution time Memory
15197 2015-07-12T03:39:40 Z ggoh 맛있는 과자 (kriii3_A) C++
33 / 33
0 ms 1204 KB
#include<cstdio>
#include<algorithm>
#include<vector>
#include<cmath>
long long s,a,b,n,k,i,j,D[44][44];
long long C(long long N,long long R)
{
	if(D[N][R])return D[N][R];
	if(R==0||R==N)return D[N][R]=1;
	if(R==1)return D[N][R]=N;
	return D[N][R]=C(N-1,R)+C(N-1,R-1);
}
main()
{
	scanf("%lld%lld%lld%lld",&a,&b,&n,&k);
	i=0;
	while(s<k)
	{
		s+=C(n,i);
		i++;
	}
	k=n-i+1;
	if(a>b)j=a,a=b,b=j;
	double sq=(double)(a*b)/(double)2;
	for(j=1;j<=k;j++)
	{
		sq*=(double)(b*b)/(double)(a*a+b*b);
	}
	for(j=1;j<=n-k;j++)
	{
		sq*=(double)(a*a)/(double)(a*a+b*b);
	}
	printf("%.10lf",log(sq));
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1204 KB Output is correct
2 Correct 0 ms 1204 KB Output is correct
3 Correct 0 ms 1204 KB Output is correct
4 Correct 0 ms 1204 KB Output is correct
5 Correct 0 ms 1204 KB Output is correct
6 Correct 0 ms 1204 KB Output is correct
7 Correct 0 ms 1204 KB Output is correct
8 Correct 0 ms 1204 KB Output is correct
9 Correct 0 ms 1204 KB Output is correct
10 Correct 0 ms 1204 KB Output is correct
11 Correct 0 ms 1204 KB Output is correct
12 Correct 0 ms 1204 KB Output is correct
13 Correct 0 ms 1204 KB Output is correct
14 Correct 0 ms 1204 KB Output is correct
15 Correct 0 ms 1204 KB Output is correct
16 Correct 0 ms 1204 KB Output is correct
17 Correct 0 ms 1204 KB Output is correct
18 Correct 0 ms 1204 KB Output is correct
19 Correct 0 ms 1204 KB Output is correct
20 Correct 0 ms 1204 KB Output is correct
21 Correct 0 ms 1204 KB Output is correct
22 Correct 0 ms 1204 KB Output is correct
23 Correct 0 ms 1204 KB Output is correct
24 Correct 0 ms 1204 KB Output is correct
25 Correct 0 ms 1204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 1204 KB Output is correct
2 Correct 0 ms 1204 KB Output is correct
3 Correct 0 ms 1204 KB Output is correct
4 Correct 0 ms 1204 KB Output is correct
5 Correct 0 ms 1204 KB Output is correct
6 Correct 0 ms 1204 KB Output is correct
7 Correct 0 ms 1204 KB Output is correct
8 Correct 0 ms 1204 KB Output is correct
9 Correct 0 ms 1204 KB Output is correct
10 Correct 0 ms 1204 KB Output is correct
11 Correct 0 ms 1204 KB Output is correct
12 Correct 0 ms 1204 KB Output is correct
13 Correct 0 ms 1204 KB Output is correct
14 Correct 0 ms 1204 KB Output is correct
15 Correct 0 ms 1204 KB Output is correct
16 Correct 0 ms 1204 KB Output is correct
17 Correct 0 ms 1204 KB Output is correct
18 Correct 0 ms 1204 KB Output is correct
19 Correct 0 ms 1204 KB Output is correct
20 Correct 0 ms 1204 KB Output is correct
21 Correct 0 ms 1204 KB Output is correct
22 Correct 0 ms 1204 KB Output is correct
23 Correct 0 ms 1204 KB Output is correct
24 Correct 0 ms 1204 KB Output is correct
25 Correct 0 ms 1204 KB Output is correct