結果

問題 No.2624 Prediction by Average
ユーザー FromBooskaFromBooska
提出日時 2024-02-21 12:45:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 66,816 KB
最終ジャッジ日時 2024-02-21 12:45:56
合計ジャッジ時間 1,597 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 36 ms
53,460 KB
testcase_04 WA -
testcase_05 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# 公式解説より、1000を超えれば常に可能なので1000までを調べる

from math import ceil, floor

T = int(input())
for t in range(T):
    N, S = map(float, input().split())
    N = int(N)
    S1000 = int(S*1000)

    ans = 0
    for n in range(1, min(1000, N)+1):
        low = (S1000*n-1)//1000
        high = ((S1000+1)*n-1)//1000
        if low != high:
            ans += 1
        #print('n', n, 'low', low, 'high', high)
    print(ans)
0