結果

問題 No.2461 一点張り
ユーザー 👑 rin204rin204
提出日時 2023-09-18 16:09:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 106 ms / 2,000 ms
コード長 224 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 87,260 KB
実行使用メモリ 76,784 KB
最終ジャッジ日時 2023-09-18 16:09:15
合計ジャッジ時間 1,830 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,688 KB
testcase_01 AC 105 ms
76,528 KB
testcase_02 AC 104 ms
76,436 KB
testcase_03 AC 102 ms
76,648 KB
testcase_04 AC 105 ms
76,724 KB
testcase_05 AC 105 ms
76,424 KB
testcase_06 AC 105 ms
76,564 KB
testcase_07 AC 106 ms
76,784 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    p, k = map(float, input().split())
    k = int(k)
    ans = 0
    P = 1
    for _ in range(k - 1):
        ans += P
        P *= 1 - p
    ans += P
    print(ans)


for _ in range(int(input())):
    solve()
0