結果
問題 | No.1200 お菓子配り-3 |
ユーザー |
👑 ![]() |
提出日時 | 2020-09-22 22:11:15 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 676 bytes |
コンパイル時間 | 226 ms |
コンパイル使用メモリ | 82,100 KB |
実行使用メモリ | 76,824 KB |
最終ジャッジ日時 | 2024-06-26 21:53:08 |
合計ジャッジ時間 | 37,500 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 30 TLE * 1 |
ソースコード
#約数全部def Divisors(N):N=abs(N)L,U=[],[]k=1while k*k <=N:if N%k== 0:L.append(k)if k!=N//k:U.append(N//k)k+=1return L+U[::-1]#====================================S=int(input())L=[0]*Sfor i in range(S):X,Y=map(int,input().split())D=Divisors(X+Y)K=0for d in D:if d==1:continueelif d==2:if X==Y:K+=X-1else:A=d-1B2=A*X-YC2=-X+A*Yif B2>0 and C2>0 and B2%(A*A-1)==C2%(A*A-1)==0:K+=1L[i]=Kprint("\n".join(map(str,L)))