結果
問題 |
No.1200 お菓子配り-3
|
ユーザー |
![]() |
提出日時 | 2024-08-13 02:58:00 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 674 bytes |
コンパイル時間 | 291 ms |
コンパイル使用メモリ | 82,260 KB |
実行使用メモリ | 120,688 KB |
最終ジャッジ日時 | 2024-08-13 02:58:47 |
合計ジャッジ時間 | 44,148 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 26 TLE * 2 -- * 3 |
ソースコード
import io, os input = io.BytesIO(os.read(0,os.fstat(0).st_size)).readline import sys T=int(input()) for tests in range(T): ANS=0 X,Y=map(int,input().split()) if X<Y: X,Y=Y,X T=X-Y xr=int(T**(1/2))+1 for i in range(1,xr+1): if T%i==0 and (X+Y)%(i+2)==0: if (T//i)%2==((X+Y)//(i+2))%2 and abs(T//i)<(X+Y)//(i+2): ANS+=1 #print(i+1) k=T//i if k<=xr: continue if T%k==0 and (X+Y)%(k+2)==0: if (T//k)%2==((X+Y)//(k+2))%2 and abs(T//k)<(X+Y)//(k+2): ANS+=1 #print(k+1) sys.stdout.write(str(ANS)+"\n")