結果

問題 No.1243 約数加算
コンテスト
ユーザー shotoyoo
提出日時 2020-10-02 22:40:26
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
MLE  
実行時間 -
コード長 495 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 223 ms
コンパイル使用メモリ 85,332 KB
実行使用メモリ 1,397,256 KB
最終ジャッジ日時 2026-04-01 13:32:46
合計ジャッジ時間 4,064 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 1 TLE * 1 MLE * 1 -- * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


t = int(input())
ans = [None]*t
from math import gcd
def sub(a,b):
    if a==b:
        return []
    l = []
    g = gcd(a,b)
    l.append(g)
    l.extend([item*g for item in sub(a//g+1,b//g)])
    return l
        
for ind in range(t):
    a,b = list(map(int, input().split()))
    ans = sub(a,b)
    print(len(ans))
    write(" ".join(map(str, ans)))
0