結果

問題 No.2461 一点張り
ユーザー 無貌無貌
提出日時 2023-11-03 06:49:30
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 205 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 11,788 KB
実行使用メモリ 10,220 KB
最終ジャッジ日時 2023-11-03 06:49:32
合計ジャッジ時間 2,247 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,156 KB
testcase_01 AC 103 ms
10,220 KB
testcase_02 AC 103 ms
10,220 KB
testcase_03 AC 181 ms
10,220 KB
testcase_04 AC 105 ms
10,220 KB
testcase_05 AC 135 ms
10,168 KB
testcase_06 AC 107 ms
10,220 KB
testcase_07 AC 38 ms
10,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

def force_int(x):
  x = float(x)
  return x if x%1 else int(x)

for _ in range(T):
  p, K = map(force_int, input().split())
  ans = 0
  for i in range(K):
    ans += (1-p)**i
  print(ans)
0