結果

問題 No.1243 約数加算
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-29 20:29:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 94 ms / 2,000 ms
コード長 253 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 86,780 KB
実行使用メモリ 76,620 KB
最終ジャッジ日時 2023-09-08 05:41:35
合計ジャッジ時間 2,016 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
70,836 KB
testcase_01 AC 73 ms
71,076 KB
testcase_02 AC 74 ms
71,072 KB
testcase_03 AC 77 ms
76,104 KB
testcase_04 AC 93 ms
76,620 KB
testcase_05 AC 93 ms
76,284 KB
testcase_06 AC 93 ms
76,556 KB
testcase_07 AC 89 ms
76,424 KB
testcase_08 AC 94 ms
76,396 KB
testcase_09 AC 80 ms
75,440 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

t=int(input())
ab=[list(map(int,input().split())) for _ in range(t)]
for a,b in ab:
  ary=[]
  while b>a:
    t=b-a
    t=1<<(t.bit_length()-1)
    while a%t!=0:
      t>>=1
    ary.append(t)
    a+=t
  assert a==b,(a,b)
  print(len(ary))
  print(*ary)
0