이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<stdio.h>
#include<algorithm>
#include<math.h>
using namespace std;
long long K, C[41][41], S;
int a, b, n;
double Res;
int main()
{
int i, j, x;
scanf("%d%d%d%lld",&a,&b,&n,&K);
if(a<b)swap(a,b);
for(i=0;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];
}
for(i=0;i<=n;i++){
S+=C[n][i];
if(S>=K)break;
}
x = i;
Res=a*b*0.5;
Res = log(Res);
for(i=1;i<=x;i++){
Res=Res+log(b*b)-log(a*a+b*b);
}
for(i=1;i<=n-x;i++){
Res=Res+log(a*a)-log(a*a+b*b);
}
printf("%.11lf\n",Res);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |