結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
59,380 KB
testcase_01 AC 61 ms
66,664 KB
testcase_02 AC 64 ms
66,664 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 77 ms
72,884 KB
testcase_05 AC 79 ms
72,876 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
    N, S = map(str, input().split())
    IN = int(N)
    IS = int(S[:-4]) * 1000 + int(S[-3:])
    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