結果

問題 No.2461 一点張り
ユーザー rlangevinrlangevin
提出日時 2023-09-08 21:25:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 77,560 KB
最終ジャッジ日時 2023-09-08 21:25:14
合計ジャッジ時間 1,803 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,060 KB
testcase_01 AC 92 ms
76,620 KB
testcase_02 AC 86 ms
76,440 KB
testcase_03 AC 91 ms
77,560 KB
testcase_04 AC 86 ms
76,892 KB
testcase_05 AC 89 ms
76,964 KB
testcase_06 AC 86 ms
76,376 KB
testcase_07 AC 87 ms
76,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

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