結果

問題 No.1243 約数加算
ユーザー sepa38sepa38
提出日時 2023-03-20 10:59:31
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 356 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 81,540 KB
実行使用メモリ 70,468 KB
最終ジャッジ日時 2023-10-18 18:02:41
合計ジャッジ時間 1,558 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,316 KB
testcase_01 AC 38 ms
53,316 KB
testcase_02 AC 39 ms
53,316 KB
testcase_03 AC 39 ms
53,316 KB
testcase_04 AC 66 ms
68,420 KB
testcase_05 AC 66 ms
70,456 KB
testcase_06 AC 67 ms
70,456 KB
testcase_07 WA -
testcase_08 AC 68 ms
70,468 KB
testcase_09 AC 40 ms
53,316 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
  a, b = map(int, input().split())
  ans = []
  for i in range(70):
    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(70)):
    x = b - a
    if x & (1 << i):
      ans.append(1<<i)
      a += 1 << i
  print(len(ans))   
  print(*ans)
0