結果

問題 No.1203 お菓子ゲーム
ユーザー ChanyuhChanyuh
提出日時 2020-08-29 10:58:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 799 bytes
コンパイル時間 438 ms
コンパイル使用メモリ 81,792 KB
実行使用メモリ 78,484 KB
最終ジャッジ日時 2024-04-26 16:13:33
合計ジャッジ時間 20,575 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 321 ms
76,768 KB
testcase_01 AC 369 ms
76,356 KB
testcase_02 AC 213 ms
77,008 KB
testcase_03 WA -
testcase_04 AC 180 ms
76,352 KB
testcase_05 AC 503 ms
77,584 KB
testcase_06 AC 325 ms
76,420 KB
testcase_07 AC 460 ms
77,144 KB
testcase_08 AC 333 ms
77,408 KB
testcase_09 AC 311 ms
77,508 KB
testcase_10 AC 501 ms
77,336 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 293 ms
77,824 KB
testcase_14 AC 301 ms
76,644 KB
testcase_15 WA -
testcase_16 AC 250 ms
76,500 KB
testcase_17 WA -
testcase_18 AC 44 ms
58,676 KB
testcase_19 AC 128 ms
76,424 KB
testcase_20 AC 38 ms
51,804 KB
testcase_21 AC 37 ms
51,840 KB
testcase_22 AC 37 ms
52,256 KB
testcase_23 AC 38 ms
51,840 KB
testcase_24 AC 40 ms
51,968 KB
testcase_25 AC 40 ms
51,840 KB
testcase_26 AC 41 ms
51,840 KB
testcase_27 AC 37 ms
51,840 KB
testcase_28 AC 38 ms
51,968 KB
testcase_29 AC 38 ms
52,352 KB
testcase_30 AC 553 ms
76,672 KB
testcase_31 AC 579 ms
77,696 KB
testcase_32 AC 529 ms
77,168 KB
testcase_33 AC 541 ms
77,408 KB
testcase_34 WA -
testcase_35 AC 554 ms
77,564 KB
testcase_36 AC 557 ms
77,696 KB
testcase_37 AC 519 ms
76,524 KB
testcase_38 AC 565 ms
77,696 KB
testcase_39 WA -
testcase_40 AC 640 ms
78,484 KB
testcase_41 AC 538 ms
77,240 KB
testcase_42 AC 567 ms
77,056 KB
testcase_43 AC 611 ms
78,184 KB
testcase_44 AC 583 ms
77,292 KB
testcase_45 AC 573 ms
77,312 KB
testcase_46 AC 552 ms
76,672 KB
testcase_47 WA -
testcase_48 AC 589 ms
77,440 KB
testcase_49 WA -
testcase_50 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def divisor_list(x):
  res=[]
  i=1
  while i*i<=x:
    if x%i==0:
      res.append(i)
      if i*i!=x:
        res.append(x//i)
    i+=1
  return res
        
n=int(input())
for i in range(n):
  ans=0
  x,y=map(int,input().split())
  #print(x,y)
  Dy=divisor_list(y)
  for d in Dy:
    if d%2==0:
      continue
    b=(d+1)/2
    if 2*b*(b-1)*y%((2*b-1)*x)!=0:
      continue
    A=2*b*(b-1)*y//((2*b-1)*x)
    if A<=0 or A>100000000:  continue
    if A<=2*b-1: continue
    ans+=1
  for d in Dy:
    if d%2==0:
      continue
    a=(d+1)/2
    if 2*a*(a-1)*y%((2*a-1)*(y-x))!=0:
      continue
    B=2*a*(a-1)*y//((2*a-1)*(y-x))
    if B<=0 or B>100000000: continue
    if B<=2*a-1: continue
    ans+=1
  if y>2*x:
    ans+=100000000//y
  if y>2*(y-x):
    ans+=100000000//y
  print(ans)
    
    
0