結果

問題 No.1871 divisXor
ユーザー NaHCO314NaHCO314
提出日時 2021-12-20 22:55:06
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 187 bytes
コンパイル時間 350 ms
コンパイル使用メモリ 87,068 KB
実行使用メモリ 71,508 KB
最終ジャッジ日時 2023-10-13 20:05:37
合計ジャッジ時間 7,043 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,264 KB
testcase_01 AC 74 ms
71,096 KB
testcase_02 AC 78 ms
71,200 KB
testcase_03 WA -
testcase_04 AC 74 ms
70,980 KB
testcase_05 AC 74 ms
71,448 KB
testcase_06 WA -
testcase_07 AC 73 ms
71,452 KB
testcase_08 WA -
testcase_09 AC 72 ms
71,312 KB
testcase_10 AC 75 ms
71,392 KB
testcase_11 AC 74 ms
71,292 KB
testcase_12 AC 73 ms
71,388 KB
testcase_13 AC 75 ms
71,312 KB
testcase_14 AC 73 ms
71,280 KB
testcase_15 WA -
testcase_16 AC 73 ms
71,196 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 73 ms
71,284 KB
testcase_20 AC 73 ms
71,312 KB
testcase_21 AC 77 ms
71,088 KB
testcase_22 AC 74 ms
71,268 KB
testcase_23 WA -
testcase_24 AC 73 ms
71,172 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 77 ms
71,136 KB
testcase_28 WA -
testcase_29 AC 72 ms
71,072 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = []

for i in range(n.bit_length()):
    if n >> i & 1 != n & n >> i + 1 & 1:
        a.append(1 << i)

if n != 0:
    print(len(a))
    print(*a)
else:
    print(-1)
0