結果

問題 No.2624 Prediction by Average
ユーザー 👑 timitimi
提出日時 2024-02-10 00:12:13
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 476 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 73,100 KB
最終ジャッジ日時 2024-02-10 00:12:15
合計ジャッジ時間 1,242 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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:
          pp,qq=y*c//cc,(y+1)*c//cc  
          c=int((pp+1)/i*1000)
          if y==c:
            ans+=1
    if x>1000:
      ans+=x-1000
    print(ans)
0