結果
問題 |
No.1203 お菓子ゲーム
|
ユーザー |
![]() |
提出日時 | 2020-08-29 10:58:06 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 799 bytes |
コンパイル時間 | 359 ms |
コンパイル使用メモリ | 82,408 KB |
実行使用メモリ | 78,200 KB |
最終ジャッジ日時 | 2024-11-14 05:27:07 |
合計ジャッジ時間 | 20,026 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 41 WA * 10 |
ソースコード
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)