結果

問題 No.2624 Prediction by Average
ユーザー AngrySadEightAngrySadEight
提出日時 2024-01-17 01:24:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 2,000 ms
コード長 395 bytes
コンパイル時間 1,781 ms
コンパイル使用メモリ 81,444 KB
実行使用メモリ 72,880 KB
最終ジャッジ日時 2024-01-17 01:24:23
合計ジャッジ時間 1,069 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,376 KB
testcase_01 AC 62 ms
66,648 KB
testcase_02 AC 66 ms
66,648 KB
testcase_03 AC 35 ms
53,460 KB
testcase_04 AC 79 ms
72,880 KB
testcase_05 AC 80 ms
72,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
assert 1 <= T <= 1000
for _ in range(T):
    N, S = map(str, input().split())
    IN = int(N)
    assert 1 <= IN <= 10 ** 13
    IS = int(S[:-4]) * 1000 + int(S[-3:])
    assert 0 <= IS <= 100000
    ans = 0
    for i in range(min(IN + 1, 1000)):
        if (IS * i - 1) // 1000 != ((IS + 1) * i - 1) // 1000:
            ans += 1
    ans += max(0, IN - 1000 + 1)
    print(ans)
0