結果

問題 No.2461 一点張り
ユーザー sasa8uyauyasasa8uyauya
提出日時 2023-09-08 21:38:36
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 154 ms / 2,000 ms
コード長 157 bytes
コンパイル時間 409 ms
コンパイル使用メモリ 87,076 KB
実行使用メモリ 78,260 KB
最終ジャッジ日時 2023-09-08 21:38:40
合計ジャッジ時間 2,129 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,624 KB
testcase_01 AC 141 ms
78,020 KB
testcase_02 AC 130 ms
77,924 KB
testcase_03 AC 154 ms
77,996 KB
testcase_04 AC 136 ms
77,980 KB
testcase_05 AC 133 ms
77,652 KB
testcase_06 AC 139 ms
78,260 KB
testcase_07 AC 111 ms
77,288 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
for _ in range(n):
	p,k=input().split()
	k=int(k)
	p=float(p)
	q=1-p
	a=0
	for i in range(1,k):
		a+=pow(q,i-1)*p*i
	a+=pow(q,k-1)*k
	print(a)
0