結果

問題 No.2125 Inverse Sum
ユーザー ShirotsumeShirotsume
提出日時 2022-11-18 22:00:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 622 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 81,644 KB
実行使用メモリ 61,580 KB
最終ジャッジ日時 2023-10-20 06:50:25
合計ジャッジ時間 7,232 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 182 ms
59,500 KB
testcase_01 AC 192 ms
59,504 KB
testcase_02 AC 191 ms
59,504 KB
testcase_03 AC 216 ms
59,504 KB
testcase_04 AC 184 ms
59,504 KB
testcase_05 WA -
testcase_06 AC 215 ms
61,556 KB
testcase_07 WA -
testcase_08 AC 184 ms
59,504 KB
testcase_09 AC 188 ms
59,504 KB
testcase_10 AC 190 ms
59,504 KB
testcase_11 AC 191 ms
59,504 KB
testcase_12 AC 193 ms
59,504 KB
testcase_13 AC 198 ms
61,580 KB
testcase_14 AC 216 ms
61,580 KB
testcase_15 AC 217 ms
61,580 KB
testcase_16 AC 218 ms
61,580 KB
testcase_17 AC 219 ms
61,580 KB
testcase_18 AC 200 ms
61,572 KB
testcase_19 AC 217 ms
61,580 KB
testcase_20 AC 201 ms
61,580 KB
testcase_21 AC 217 ms
61,580 KB
testcase_22 AC 216 ms
61,580 KB
testcase_23 AC 190 ms
59,504 KB
testcase_24 WA -
testcase_25 AC 182 ms
59,504 KB
testcase_26 AC 192 ms
59,504 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 186 ms
59,504 KB
testcase_31 WA -
testcase_32 AC 186 ms
61,560 KB
権限があれば一括ダウンロードができます

ソースコード

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 ** 7):
    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