結果

問題 No.2624 Prediction by Average
ユーザー anonymouslyanonymously
提出日時 2024-02-09 21:58:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 445 ms / 2,000 ms
コード長 371 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 11,776 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-02-09 21:58:52
合計ジャッジ時間 2,163 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
9,984 KB
testcase_01 AC 242 ms
10,112 KB
testcase_02 AC 445 ms
10,112 KB
testcase_03 AC 28 ms
9,984 KB
testcase_04 AC 397 ms
10,112 KB
testcase_05 AC 383 ms
10,112 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for t in range(T):
    case=input().split()
    n=int(case[0])
    s=case[1].split('.')[1] if '.' in case[1] else "000"
    while len(s)<3:
        s+='0'
    decimal_part=int(s)
    ans=max(0,n-999)
    for i in range(1,min(n+1,1000)):
        m=(i*decimal_part+999)//1000
        d=m*1000//i
        if(d==decimal_part):
            ans+=1
    print(ans)
0