結果

問題 No.2461 一点張り
ユーザー hirayuu_ychirayuu_yc
提出日時 2023-09-08 21:24:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 102 ms / 2,000 ms
コード長 207 bytes
コンパイル時間 900 ms
コンパイル使用メモリ 86,660 KB
実行使用メモリ 77,516 KB
最終ジャッジ日時 2023-09-08 21:24:17
合計ジャッジ時間 1,754 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,412 KB
testcase_01 AC 97 ms
77,464 KB
testcase_02 AC 99 ms
77,104 KB
testcase_03 AC 98 ms
76,936 KB
testcase_04 AC 100 ms
77,516 KB
testcase_05 AC 97 ms
77,464 KB
testcase_06 AC 97 ms
77,200 KB
testcase_07 AC 102 ms
76,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for i in range(T):
    p,K=input().split()
    p=float(p)
    K=int(K)
    ans=0
    now=1
    for i in range(K-1):
        ans+=now*p*(i+1)
        now=now*(1-p)
    ans+=now*K
    print(ans)
0