結果
問題 | No.1243 約数加算 |
ユーザー | masa_aa |
提出日時 | 2020-10-02 22:06:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 503 bytes |
コンパイル時間 | 337 ms |
コンパイル使用メモリ | 86,808 KB |
実行使用メモリ | 76,912 KB |
最終ジャッジ日時 | 2023-09-24 12:35:00 |
合計ジャッジ時間 | 3,115 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | WA | - |
testcase_09 | WA | - |
ソースコード
from math import gcd import sys sys.setrecursionlimit(10000000) input = sys.stdin.readline for _ in range(int(input())): a, b = map(int, input().split()) k = b - a res = [] for i in range(61): if k < 1 << i: break else: if a >> i & 1: a += 1 << i k -= 1 << i res.append(1 << i) for i in range(60, -1, -1): if k >> i & 1: res.append(1 << i) print(" ".join(map(str, res)))