結果

問題 No.2125 Inverse Sum
ユーザー ShirotsumeShirotsume
提出日時 2022-11-18 21:57:29
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 622 bytes
コンパイル時間 2,082 ms
コンパイル使用メモリ 81,348 KB
実行使用メモリ 61,548 KB
最終ジャッジ日時 2023-10-20 06:47:59
合計ジャッジ時間 3,320 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
59,464 KB
testcase_01 AC 60 ms
59,468 KB
testcase_02 AC 60 ms
59,468 KB
testcase_03 AC 62 ms
59,468 KB
testcase_04 AC 58 ms
59,468 KB
testcase_05 WA -
testcase_06 AC 49 ms
59,340 KB
testcase_07 WA -
testcase_08 AC 58 ms
59,468 KB
testcase_09 AC 58 ms
59,468 KB
testcase_10 AC 59 ms
59,468 KB
testcase_11 AC 59 ms
59,468 KB
testcase_12 AC 59 ms
59,468 KB
testcase_13 AC 63 ms
61,544 KB
testcase_14 AC 66 ms
61,544 KB
testcase_15 AC 64 ms
61,544 KB
testcase_16 AC 65 ms
61,544 KB
testcase_17 AC 65 ms
61,544 KB
testcase_18 AC 61 ms
61,536 KB
testcase_19 AC 66 ms
61,544 KB
testcase_20 AC 63 ms
61,544 KB
testcase_21 AC 65 ms
61,544 KB
testcase_22 AC 65 ms
61,544 KB
testcase_23 AC 59 ms
59,468 KB
testcase_24 WA -
testcase_25 AC 58 ms
59,468 KB
testcase_26 AC 59 ms
59,468 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 59 ms
59,468 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from collections import deque, Counter
sys.setrecursionlimit(5 * 10 ** 5)
from pypyjit import set_param
set_param('max_unroll_recursion=-1')
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353

p, q = mi()

ans = []
for n in range(1, 10 ** 6):
    if p * n - q > 0 and (q * n) % (p * n - q) == 0:
        m = (q * n) // (p * n - q)
        if m > 0:
            ans.append((n, m))
            ans.append((m, n))
ans = list(set(ans))

ans.sort()
print(len(ans))
for n, m in ans:
    print(n, m)
0