結果

問題 No.2461 一点張り
ユーザー ryohei22ryohei22
提出日時 2023-09-08 22:00:14
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 147 ms / 2,000 ms
コード長 178 bytes
コンパイル時間 535 ms
コンパイル使用メモリ 86,836 KB
実行使用メモリ 78,032 KB
最終ジャッジ日時 2023-09-08 22:00:16
合計ジャッジ時間 2,172 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,668 KB
testcase_01 AC 125 ms
77,440 KB
testcase_02 AC 123 ms
78,032 KB
testcase_03 AC 147 ms
77,936 KB
testcase_04 AC 126 ms
77,928 KB
testcase_05 AC 131 ms
77,676 KB
testcase_06 AC 121 ms
77,428 KB
testcase_07 AC 105 ms
77,476 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
	p, K = input().split()
	p = float(p)
	K = int(K)

	ans = K * (1 - p)**(K - 1)
	for i in range(1, K):
		ans += i * (1 - p)**(i - 1) * p

	print(ans)
0