結果

問題 No.2461 一点張り
ユーザー moon17moon17
提出日時 2023-09-30 20:23:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 170 bytes
コンパイル時間 1,021 ms
コンパイル使用メモリ 86,560 KB
実行使用メモリ 77,340 KB
最終ジャッジ日時 2023-09-30 20:23:50
合計ジャッジ時間 2,328 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,320 KB
testcase_01 AC 107 ms
77,192 KB
testcase_02 AC 95 ms
77,272 KB
testcase_03 AC 96 ms
77,272 KB
testcase_04 AC 96 ms
77,108 KB
testcase_05 AC 94 ms
77,124 KB
testcase_06 AC 94 ms
77,340 KB
testcase_07 AC 96 ms
76,816 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

0