結果
問題 | No.2624 Prediction by Average |
ユーザー | rlangevin |
提出日時 | 2024-03-11 12:21:27 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 71 ms / 2,000 ms |
コード長 | 337 bytes |
コンパイル時間 | 358 ms |
コンパイル使用メモリ | 81,572 KB |
実行使用メモリ | 64,452 KB |
最終ジャッジ日時 | 2024-03-11 12:21:29 |
合計ジャッジ時間 | 1,456 ms |
ジャッジサーバーID (参考情報) |
judge14 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 43 ms
59,980 KB |
testcase_01 | AC | 54 ms
64,452 KB |
testcase_02 | AC | 59 ms
64,448 KB |
testcase_03 | AC | 41 ms
53,460 KB |
testcase_04 | AC | 71 ms
64,436 KB |
testcase_05 | AC | 56 ms
64,436 KB |
ソースコード
import sys input = sys.stdin.readline T = int(input()) for _ in range(T): N, S = input().split() N = int(N) S = int(S.split(".")[1]) ans = max(0, N - 999) for i in range(1, min(N+1, 1000)): l = (S * i + 999) // 1000 r = ((S + 1) * i - 1) // 1000 if l <= r: ans += 1 print(ans)