結果

問題 No.2624 Prediction by Average
ユーザー titiatitia
提出日時 2024-02-09 23:13:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 378 bytes
コンパイル時間 175 ms
コンパイル使用メモリ 11,904 KB
実行使用メモリ 9,984 KB
最終ジャッジ日時 2024-02-09 23:13:35
合計ジャッジ時間 2,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
input = sys.stdin.readline

T=int(input())
for tests in range(T):
    N,S=input().split()
    N=int(N)
    x=S.index(".")
    S=int(S[x+1:])

    ANS=0

    for i in range(1,min(N,1500)+1):
        if (S*i)%1000==0:
            ANS+=1
        else:
            if (S*i)//1000!=(S+1)*i//1000:
                ANS+=1

    if N>1500:
        ANS+=N-1500

    print(ANS)
0