結果

問題 No.1243 約数加算
ユーザー qibqib
提出日時 2023-03-08 00:36:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 273 bytes
コンパイル時間 1,692 ms
コンパイル使用メモリ 81,568 KB
実行使用メモリ 68,432 KB
最終ジャッジ日時 2023-10-18 05:42:04
合計ジャッジ時間 1,724 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,424 KB
testcase_01 AC 40 ms
53,424 KB
testcase_02 AC 39 ms
53,424 KB
testcase_03 AC 45 ms
59,584 KB
testcase_04 AC 57 ms
64,300 KB
testcase_05 AC 68 ms
68,432 KB
testcase_06 AC 60 ms
66,352 KB
testcase_07 AC 55 ms
64,300 KB
testcase_08 AC 60 ms
66,352 KB
testcase_09 AC 43 ms
59,588 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t = int(input())
for _ in range(t):
  a, b = map(int, input().split())
  cur = b
  ans = []
  while cur > a:
    d = 1
    while cur % (2 * d) == 0 and cur - (2 * d) >= a:
      d *= 2
    ans.append(d)
    cur -= d

  ans.reverse()
  print(len(ans))
  print(*ans, sep=" ")
0