結果

問題 No.2624 Prediction by Average
ユーザー loop0919loop0919
提出日時 2024-01-05 02:28:44
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 259 ms
コンパイル使用メモリ 81,572 KB
実行使用メモリ 75,432 KB
最終ジャッジ日時 2024-01-05 02:28:45
合計ジャッジ時間 1,199 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
59,860 KB
testcase_01 AC 69 ms
70,312 KB
testcase_02 AC 78 ms
75,432 KB
testcase_03 AC 36 ms
53,460 KB
testcase_04 AC 81 ms
75,336 KB
testcase_05 AC 80 ms
72,392 KB
権限があれば一括ダウンロードができます

ソースコード

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