結果

問題 No.2624 Prediction by Average
ユーザー 👑 loop0919
提出日時 2024-01-05 02:28:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 75,804 KB
最終ジャッジ日時 2024-09-27 18:57:40
合計ジャッジ時間 1,080 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N, S = input().split()
    N = int(N); S = int(S.replace(".", ""))
    
    cnt = 0
    for i in range(1, min(N, 999) + 1):
        left = S*i; right = left + i
        if left <= right // 1000 * 1000 < right:
            cnt += 1
    
    cnt += max(N - 999, 0)
    print(cnt)

T = int(input())
for _ in range(T):
    solve()
0