이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<cstdio>
#include<cmath>
long long d[44][44];
int main()
{
double res;
int i,j,a,b,n;
long long k;
scanf("%d%d%d%lld",&a,&b,&n,&k);
if(a<b)a^=b^=a^=b;
for(i=0;i<=n;i++)
{
d[i][0]=d[i][i]=1;
for(j=1;j<i;j++)d[i][j]=d[i-1][j]+d[i-1][j-1];
}
for(j=0;j<=n;j++)
{
if(k>d[n][j])k-=d[n][j];
else break;
}
res=log(a*b/2.);
for(i=0;i<j;i++)res+=log(1.*b*b/(a*a+b*b));
for(i=j;i<n;i++)res+=log(1.*a*a/(a*a+b*b));
printf("%.12lf\n",res);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |