結果

問題 No.2624 Prediction by Average
ユーザー miscalcmiscalc
提出日時 2024-02-10 01:12:17
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 324 bytes
コンパイル時間 198 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 73,020 KB
最終ジャッジ日時 2024-02-10 01:12:19
合計ジャッジ時間 1,179 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
58,828 KB
testcase_01 AC 63 ms
66,764 KB
testcase_02 AC 69 ms
66,764 KB
testcase_03 AC 37 ms
53,460 KB
testcase_04 AC 80 ms
73,020 KB
testcase_05 AC 82 ms
72,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def divceil(a, b):
  return (a + b - 1) // b

t = int(input())
for _ in range(t):
  n, s = input().split()
  n = int(n)
  s = int(s.split(".")[1])
  ans = 0
  for i in range(min(n + 1, 1000)):
    l, r = divceil(s * i, 1000), divceil((s + 1) * i, 1000)
    if r - l >= 1:
      ans += 1
  ans += max(0, n - 999)
  print(ans)
0