結果

問題 No.1243 約数加算
ユーザー sepa38sepa38
提出日時 2023-03-20 10:59:00
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 157 ms
コンパイル使用メモリ 82,660 KB
実行使用メモリ 72,488 KB
最終ジャッジ日時 2024-09-18 14:01:12
合計ジャッジ時間 1,633 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  a, b = map(int, input().split())
  ans = []
  for i in range(60):
    x = b - a
    if x - (1 << i) > (1 << i) and a & ((1 << (i + 1)) - 1):
      ans.append(1<<i)
      a += 1 << i
  for i in reversed(range(60)):
    x = b - a
    if x & (1 << i):
      ans.append(1<<i)
      a += 1 << i
  print(len(ans))   
  print(*ans)
0