結果

問題 No.2461 一点張り
ユーザー cologne
提出日時 2025-06-12 16:48:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 301 bytes
コンパイル時間 233 ms
コンパイル使用メモリ 82,816 KB
実行使用メモリ 67,584 KB
最終ジャッジ日時 2025-06-12 16:49:53
合計ジャッジ時間 1,307 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 7
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    t = int(input())
    for _ in range(t):
        p, k = input().split()
        p, k = float(p), int(k)
        e = 0
        z = 1
        for i in range(1, k):
            e += p * z * i
            z *= 1-p
        e += z * k
        print(e)


if __name__ == '__main__':
    main()
0