結果
問題 | No.1243 約数加算 |
ユーザー | shotoyoo |
提出日時 | 2020-10-02 22:38:02 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 468 bytes |
コンパイル時間 | 280 ms |
コンパイル使用メモリ | 86,936 KB |
実行使用メモリ | 837,728 KB |
最終ジャッジ日時 | 2023-09-24 21:54:20 |
合計ジャッジ時間 | 4,369 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 77 ms
71,240 KB |
testcase_01 | AC | 77 ms
71,180 KB |
testcase_02 | AC | 77 ms
71,544 KB |
testcase_03 | MLE | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
ソースコード
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(sub(a+g,b)) 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)))