結果
問題 | No.1243 約数加算 |
ユーザー | shotoyoo |
提出日時 | 2020-10-02 22:40:26 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 495 bytes |
コンパイル時間 | 1,193 ms |
コンパイル使用メモリ | 86,592 KB |
実行使用メモリ | 834,596 KB |
最終ジャッジ日時 | 2023-09-24 22:00:11 |
合計ジャッジ時間 | 5,314 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 74 ms
71,288 KB |
testcase_01 | AC | 77 ms
75,348 KB |
testcase_02 | AC | 75 ms
71,380 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([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)))