結果
問題 | No.1200 お菓子配り-3 |
ユーザー |
👑 ![]() |
提出日時 | 2020-08-28 22:14:11 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 613 bytes |
コンパイル時間 | 584 ms |
コンパイル使用メモリ | 82,488 KB |
実行使用メモリ | 76,796 KB |
最終ジャッジ日時 | 2024-11-14 15:28:27 |
合計ジャッジ時間 | 37,744 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 28 WA * 2 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)[1:]K=0for a in D:if a==2:K+=(X==Y)else:p=a-1B=(p*X-Y)C=(-X+p*Y)if B>0 and C>0 and B%(p*p-1)==C%(p*p-1)==0:K+=1L[i]=Kprint("\n".join(map(str,L)))