結果

問題 No.1243 約数加算
ユーザー O2MTO2MT
提出日時 2020-12-09 12:34:57
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 506 bytes
コンパイル時間 176 ms
コンパイル使用メモリ 81,652 KB
実行使用メモリ 61,700 KB
最終ジャッジ日時 2023-10-19 04:49:52
合計ジャッジ時間 4,567 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
53,284 KB
testcase_01 AC 43 ms
57,312 KB
testcase_02 AC 42 ms
57,312 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
MAX_COUNT = 120
for _ in range(T):
    A,B = map(int,input().split())
    count = 0
    flg = False
    l = []
    while count < MAX_COUNT:
        for m in range(A,0,-1):
            if A%m == 0:
                if A+m <= B:
                    A += m
                    l.append(m)
                    count += 1
                    if A == B:
                        flg = True
                    break
        if flg:
            print(len(l))
            print(*l)
            break
0