結果

問題 No.2461 一点張り
ユーザー mymelochanmymelochan
提出日時 2023-09-08 21:27:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 677 bytes
コンパイル時間 277 ms
コンパイル使用メモリ 87,104 KB
実行使用メモリ 78,244 KB
最終ジャッジ日時 2023-09-08 21:27:44
合計ジャッジ時間 1,988 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,764 KB
testcase_01 AC 119 ms
78,136 KB
testcase_02 AC 125 ms
78,136 KB
testcase_03 AC 120 ms
78,244 KB
testcase_04 AC 121 ms
77,752 KB
testcase_05 AC 120 ms
78,116 KB
testcase_06 AC 117 ms
77,968 KB
testcase_07 AC 147 ms
77,832 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#############################################################

import sys
sys.setrecursionlimit(10**7)

from heapq import heappop,heappush
from collections import deque,defaultdict,Counter
from bisect import bisect_left, bisect_right
from itertools import product,combinations,permutations

ipt = sys.stdin.readline

def iin():
    return int(ipt())
def lmin():
    return list(map(int,ipt().split()))

MOD = 998244353
#############################################################

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