結果

問題 No.1243 約数加算
ユーザー titiatitia
提出日時 2020-10-02 21:38:29
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 242 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,540 KB
実行使用メモリ 43,964 KB
最終ジャッジ日時 2023-09-23 04:24:48
合計ジャッジ時間 3,873 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

import sys
input = sys.stdin.readline
from math import gcd

T=int(input())
for tests in range(T):
    A,B=map(int,input().split())
    ANS=[]
    while A!=B:
        ANS.append(gcd(A,B))
        A+=gcd(A,B)
    print(len(ANS))
    print(*ANS)
0