結果

問題 No.2624 Prediction by Average
ユーザー nikoro256nikoro256
提出日時 2024-02-09 22:18:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 392 bytes
コンパイル時間 136 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 70,920 KB
最終ジャッジ日時 2024-02-09 22:18:28
合計ジャッジ時間 936 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
59,976 KB
testcase_01 AC 62 ms
68,856 KB
testcase_02 AC 62 ms
68,856 KB
testcase_03 AC 30 ms
53,460 KB
testcase_04 AC 63 ms
70,920 KB
testcase_05 AC 67 ms
70,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
    N,S=map(str,input().split())
    N=int(N)
    S=list(S)
    S.remove('.')
    S=int(''.join(S))
    count=max(0,N-999)
    N=min(999,N)
    for n in range(1,min(1000,N+1)):
        tmp=(S+1)*n//1000-S*n//1000
        if S*n%1000==0:
            tmp+=1
        if (S+1)*n%1000==0:
            tmp-=1
        if tmp>0:
            count+=1
    print(count)
0