Submission #15197

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