Submission #15186

#TimeUsernameProblemLanguageResultExecution timeMemory
15186gs13068맛있는 과자 (kriii3_A)C++98
33 / 33
0 ms1204 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...