結果
| 問題 |
No.813 ユキちゃんの冒険
|
| コンテスト | |
| ユーザー |
sho_00
|
| 提出日時 | 2020-04-08 18:26:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 387 bytes |
| コンパイル時間 | 64 ms |
| コンパイル使用メモリ | 12,288 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-19 02:31:28 |
| 合計ジャッジ時間 | 1,669 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 4 WA * 22 |
ソースコード
import math
n=int(input())
p=float(input())
q=float(input())
if p==1:
print(1)
elif q==1:
print(0)
else:
N=min(int((-5-math.log10(p))/(math.log10(p)+math.log10(q)))+1,n)
ans=0
for i in range(N+1):
if i==0:
ans+=p
elif i==1:
ans+=p**2*q
else:
C=math.factorial(2*i+2)//math.factorial(i+1)//math.factorial(i+1)
ans+=C*q**i*p**(i+1)
print(ans)
sho_00