結果

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

テストケース

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

ソースコード

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