結果

問題 No.2624 Prediction by Average
ユーザー timitimi
提出日時 2024-02-10 00:33:21
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 87 ms / 2,000 ms
コード長 418 bytes
コンパイル時間 256 ms
コンパイル使用メモリ 82,984 KB
実行使用メモリ 74,420 KB
最終ジャッジ日時 2024-09-28 16:46:11
合計ジャッジ時間 1,150 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for i in range(T):
  x,y=input().split()
  if y=='100.000':
    print(x)
  else:
    y=y.replace('.','')
    x,y=int(x),int(y)
    ans=0
    for i in range(1,min(1001,x+1)):
      if y*i%1000==0:
        ans+=1
      else:
        c=100*i
        cc=10**5
        p,q=y*c//cc,(y+1)*c//cc  
        if p!=q:
          if (y+1)*i%1000!=0:
            ans+=1
    if x>1000:
      ans+=x-1000
    print(ans)
0