結果

問題 No.1871 divisXor
ユーザー NaHCO314NaHCO314
提出日時 2021-12-20 22:54:52
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 202 bytes
コンパイル時間 1,682 ms
コンパイル使用メモリ 86,660 KB
実行使用メモリ 71,592 KB
最終ジャッジ日時 2023-10-13 20:05:18
合計ジャッジ時間 7,734 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,296 KB
testcase_01 AC 72 ms
71,288 KB
testcase_02 AC 73 ms
71,228 KB
testcase_03 WA -
testcase_04 AC 72 ms
71,064 KB
testcase_05 AC 73 ms
71,288 KB
testcase_06 WA -
testcase_07 AC 74 ms
71,240 KB
testcase_08 WA -
testcase_09 AC 71 ms
71,344 KB
testcase_10 AC 73 ms
71,344 KB
testcase_11 AC 70 ms
71,116 KB
testcase_12 AC 72 ms
71,284 KB
testcase_13 AC 77 ms
71,124 KB
testcase_14 AC 72 ms
71,524 KB
testcase_15 WA -
testcase_16 AC 73 ms
71,284 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 AC 73 ms
71,228 KB
testcase_20 AC 73 ms
71,288 KB
testcase_21 AC 73 ms
71,280 KB
testcase_22 AC 74 ms
71,108 KB
testcase_23 WA -
testcase_24 AC 73 ms
71,228 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 74 ms
71,220 KB
testcase_28 WA -
testcase_29 AC 72 ms
71,340 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)

print(bin(n))
0