結果

問題 No.2461 一点張り
ユーザー ゼットゼット
提出日時 2023-09-08 21:23:28
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 110 ms / 2,000 ms
コード長 209 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 77,676 KB
最終ジャッジ日時 2023-09-08 21:23:40
合計ジャッジ時間 1,906 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,196 KB
testcase_01 AC 110 ms
77,516 KB
testcase_02 AC 96 ms
77,584 KB
testcase_03 AC 101 ms
77,452 KB
testcase_04 AC 100 ms
77,448 KB
testcase_05 AC 98 ms
77,464 KB
testcase_06 AC 99 ms
77,676 KB
testcase_07 AC 101 ms
77,052 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

Q=int(input())
for _ in range(Q):
  result=0
  p,K=map(float,input().split())
  K=round(K)
  ans=1
  w=0
  for x in range(1,K):
    result+=x*(ans*p)
    w+=ans*p
    ans*=1-p
  result+=K*(1-w)
  print(result)
0