結果
| 問題 |
No.1243 約数加算
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-10-02 22:38:02 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
MLE
|
| 実行時間 | - |
| コード長 | 468 bytes |
| コンパイル時間 | 162 ms |
| コンパイル使用メモリ | 82,472 KB |
| 実行使用メモリ | 849,148 KB |
| 最終ジャッジ日時 | 2024-07-17 22:17:13 |
| 合計ジャッジ時間 | 3,184 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 2 MLE * 1 -- * 6 |
ソースコード
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)))