結果
問題 | No.2461 一点張り |
ユーザー |
![]() |
提出日時 | 2023-09-08 22:39:18 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 80 ms / 2,000 ms |
コード長 | 365 bytes |
コンパイル時間 | 327 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 76,596 KB |
最終ジャッジ日時 | 2024-06-26 15:51:30 |
合計ジャッジ時間 | 1,464 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 7 |
ソースコード
T = int(input()) for t in range(T): p, K = map(float, input().split()) K = int(K) prob = [0]*(K+1) cumu = 0 for i in range(1, K+1): if i == K: prob[i] = 1-cumu else: prob[i] = (1-cumu)*p cumu += prob[i] EV = 0 for i in range(1, K+1): EV += i*prob[i] #print(prob) print(EV)