結果

問題 No.2125 Inverse Sum
ユーザー u_kunu_kun
提出日時 2022-11-18 22:43:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 357 bytes
コンパイル時間 2,219 ms
コンパイル使用メモリ 81,500 KB
実行使用メモリ 59,416 KB
最終ジャッジ日時 2023-10-20 07:43:06
合計ジャッジ時間 59,799 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1,658 ms
57,276 KB
testcase_01 AC 1,829 ms
59,324 KB
testcase_02 AC 38 ms
53,284 KB
testcase_03 AC 1,831 ms
57,276 KB
testcase_04 AC 1,816 ms
59,324 KB
testcase_05 WA -
testcase_06 AC 1,829 ms
59,336 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 1,790 ms
59,324 KB
testcase_10 AC 1,786 ms
59,324 KB
testcase_11 AC 1,820 ms
59,324 KB
testcase_12 AC 1,825 ms
59,324 KB
testcase_13 AC 1,837 ms
59,352 KB
testcase_14 AC 1,832 ms
59,352 KB
testcase_15 AC 1,857 ms
59,352 KB
testcase_16 AC 1,833 ms
59,352 KB
testcase_17 AC 1,832 ms
59,352 KB
testcase_18 AC 1,807 ms
59,336 KB
testcase_19 AC 1,832 ms
59,352 KB
testcase_20 AC 1,857 ms
59,352 KB
testcase_21 AC 1,828 ms
59,352 KB
testcase_22 AC 1,827 ms
59,352 KB
testcase_23 AC 1,761 ms
57,276 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 38 ms
53,284 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 1,819 ms
59,324 KB
testcase_31 WA -
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

if P > Q * 2:
    print(0)
    exit()

ans_list = []

for M in range(1, 10 ** 8):
    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