結果

問題 No.2125 Inverse Sum
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-11-18 22:04:08
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 304 bytes
コンパイル時間 191 ms
コンパイル使用メモリ 81,836 KB
実行使用メモリ 62,060 KB
最終ジャッジ日時 2023-10-20 06:53:36
合計ジャッジ時間 2,665 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
57,800 KB
testcase_01 AC 41 ms
59,852 KB
testcase_02 AC 41 ms
57,804 KB
testcase_03 AC 44 ms
59,852 KB
testcase_04 AC 39 ms
57,804 KB
testcase_05 WA -
testcase_06 AC 37 ms
57,676 KB
testcase_07 WA -
testcase_08 AC 39 ms
57,804 KB
testcase_09 AC 40 ms
59,852 KB
testcase_10 AC 38 ms
57,804 KB
testcase_11 AC 39 ms
57,804 KB
testcase_12 AC 45 ms
57,804 KB
testcase_13 AC 43 ms
59,880 KB
testcase_14 AC 45 ms
62,060 KB
testcase_15 AC 44 ms
62,060 KB
testcase_16 AC 48 ms
59,880 KB
testcase_17 AC 44 ms
59,880 KB
testcase_18 AC 42 ms
59,880 KB
testcase_19 AC 43 ms
59,880 KB
testcase_20 AC 42 ms
59,880 KB
testcase_21 AC 45 ms
62,060 KB
testcase_22 AC 44 ms
62,060 KB
testcase_23 AC 40 ms
59,852 KB
testcase_24 WA -
testcase_25 AC 39 ms
57,804 KB
testcase_26 AC 39 ms
57,804 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 40 ms
59,852 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

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