답안 #15478

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
15478 2015-07-12T08:16:14 Z pichulia 맛있는 과자 (kriii3_A) C++
33 / 33
0 ms 1212 KB
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
long long int a,b,n,k;
long long int c[50][50];
int main()
{
	scanf("%lld %lld %lld %lld",&a,&b,&n,&k);
	if(a<b)
	{
		long long int tt = a;
		a = b;
		b = tt;
	}
	int i, j;
	c[0][0]=1;
	for(i=1;i<=n;i++)
	{
		c[i][0] = 1;
		for(j=1;j<=i;j++)
		{
			c[i][j] = c[i-1][j-1] + c[i-1][j];
		}
	}
	i=0;
	while(1)
	{
		if(k <= c[n][i])break;
		k -= c[n][i];
		i++;
	}
	double aa = log(a)*2;
	double bb = log(b)*2;
	double cc = log(a*a+b*b)*n;
	printf("%.10lf\n",aa*(n-i) + bb*i - cc + log(a*b/2.0));
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1212 KB Output is correct
2 Correct 0 ms 1212 KB Output is correct
3 Correct 0 ms 1212 KB Output is correct
4 Correct 0 ms 1212 KB Output is correct
5 Correct 0 ms 1212 KB Output is correct
6 Correct 0 ms 1212 KB Output is correct
7 Correct 0 ms 1212 KB Output is correct
8 Correct 0 ms 1212 KB Output is correct
9 Correct 0 ms 1212 KB Output is correct
10 Correct 0 ms 1212 KB Output is correct
11 Correct 0 ms 1212 KB Output is correct
12 Correct 0 ms 1212 KB Output is correct
13 Correct 0 ms 1212 KB Output is correct
14 Correct 0 ms 1212 KB Output is correct
15 Correct 0 ms 1212 KB Output is correct
16 Correct 0 ms 1212 KB Output is correct
17 Correct 0 ms 1212 KB Output is correct
18 Correct 0 ms 1212 KB Output is correct
19 Correct 0 ms 1212 KB Output is correct
20 Correct 0 ms 1212 KB Output is correct
21 Correct 0 ms 1212 KB Output is correct
22 Correct 0 ms 1212 KB Output is correct
23 Correct 0 ms 1212 KB Output is correct
24 Correct 0 ms 1212 KB Output is correct
25 Correct 0 ms 1212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1212 KB Output is correct
2 Correct 0 ms 1212 KB Output is correct
3 Correct 0 ms 1212 KB Output is correct
4 Correct 0 ms 1212 KB Output is correct
5 Correct 0 ms 1212 KB Output is correct
6 Correct 0 ms 1212 KB Output is correct
7 Correct 0 ms 1212 KB Output is correct
8 Correct 0 ms 1212 KB Output is correct
9 Correct 0 ms 1212 KB Output is correct
10 Correct 0 ms 1212 KB Output is correct
11 Correct 0 ms 1212 KB Output is correct
12 Correct 0 ms 1212 KB Output is correct
13 Correct 0 ms 1212 KB Output is correct
14 Correct 0 ms 1212 KB Output is correct
15 Correct 0 ms 1212 KB Output is correct
16 Correct 0 ms 1212 KB Output is correct
17 Correct 0 ms 1212 KB Output is correct
18 Correct 0 ms 1212 KB Output is correct
19 Correct 0 ms 1212 KB Output is correct
20 Correct 0 ms 1212 KB Output is correct
21 Correct 0 ms 1212 KB Output is correct
22 Correct 0 ms 1212 KB Output is correct
23 Correct 0 ms 1212 KB Output is correct
24 Correct 0 ms 1212 KB Output is correct
25 Correct 0 ms 1212 KB Output is correct