結果

問題 No.2461 一点張り
ユーザー 👑 KazunKazun
提出日時 2021-05-24 23:22:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 763 ms / 2,000 ms
コード長 309 bytes
コンパイル時間 284 ms
コンパイル使用メモリ 87,192 KB
実行使用メモリ 95,552 KB
最終ジャッジ日時 2023-09-08 15:00:06
合計ジャッジ時間 6,314 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 224 ms
89,212 KB
testcase_01 AC 763 ms
94,928 KB
testcase_02 AC 716 ms
95,552 KB
testcase_03 AC 690 ms
94,664 KB
testcase_04 AC 674 ms
95,152 KB
testcase_05 AC 658 ms
95,172 KB
testcase_06 AC 663 ms
95,104 KB
testcase_07 AC 395 ms
93,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from decimal import getcontext,Decimal
import sys

input=sys.stdin.readline
write=sys.stdout.write

getcontext().prec=30

T=int(input())
X=[0]*T

for case in range(T):
    p,K=map(Decimal,input().split())

    if p>0:
        X[case]=(1-pow(1-p,K))/p
    else:
        X[case]=K

write("\n".join(map(str,X)))
0