結果

問題 No.2125 Inverse Sum
ユーザー u_kunu_kun
提出日時 2022-11-18 22:11:38
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 318 bytes
コンパイル時間 195 ms
コンパイル使用メモリ 81,676 KB
実行使用メモリ 59,464 KB
最終ジャッジ日時 2023-10-20 07:00:52
合計ジャッジ時間 8,768 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 203 ms
57,388 KB
testcase_01 AC 229 ms
57,388 KB
testcase_02 AC 217 ms
57,388 KB
testcase_03 AC 217 ms
57,388 KB
testcase_04 AC 217 ms
57,388 KB
testcase_05 WA -
testcase_06 AC 222 ms
59,448 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 218 ms
57,388 KB
testcase_10 AC 215 ms
57,388 KB
testcase_11 AC 217 ms
57,388 KB
testcase_12 AC 217 ms
57,388 KB
testcase_13 AC 226 ms
59,464 KB
testcase_14 AC 223 ms
59,464 KB
testcase_15 AC 224 ms
59,464 KB
testcase_16 AC 226 ms
59,464 KB
testcase_17 AC 225 ms
59,464 KB
testcase_18 AC 219 ms
59,448 KB
testcase_19 AC 222 ms
59,464 KB
testcase_20 AC 223 ms
59,464 KB
testcase_21 AC 226 ms
59,464 KB
testcase_22 AC 222 ms
59,464 KB
testcase_23 AC 214 ms
57,388 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 211 ms
57,388 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 217 ms
57,388 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

P, Q = map(int, input().split())

ans_list = []

for M in range(1, 10 ** 7):
    if Q - P * M != 0:
        if (-M * Q) % (Q - P * M) == 0:
            N = (-M * Q) // (Q - P * M)
            if N > 0:
                ans_list.append((N, M))

ans_list.sort()

print(len(ans_list))
for t in ans_list:
    print(*t)
    
0