結果

問題 No.2125 Inverse Sum
ユーザー aaaaaaaaaa2230
提出日時 2022-11-18 22:04:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 138 ms
コンパイル使用メモリ 81,768 KB
実行使用メモリ 62,200 KB
最終ジャッジ日時 2024-09-20 02:25:33
合計ジャッジ時間 2,402 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

p,q = map(int,input().split())
g = math.gcd(p,q)
p //= g
q //= g

ans = set()

for i in range(1,10**5):
    if p*i-q <= 0:
        continue

    if q*i%(p*i-q) == 0:
        m = q*i // (p*i-q)
        ans.add((i,m))
        ans.add((m,i))

print(len(ans))
for i in sorted(ans):
    print(*i)
0