結果
| 問題 |
No.1871 divisXor
|
| コンテスト | |
| ユーザー |
H20
|
| 提出日時 | 2022-03-11 22:53:20 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 40 ms / 2,000 ms |
| コード長 | 198 bytes |
| コンパイル時間 | 365 ms |
| コンパイル使用メモリ | 82,324 KB |
| 実行使用メモリ | 54,124 KB |
| 最終ジャッジ日時 | 2024-09-22 12:59:46 |
| 合計ジャッジ時間 | 3,854 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 29 |
ソースコード
N = int(input())
if N==0:
print(-1)
exit()
L = format(N, 'b')[::-1]
ANS = [2**(len(L)-1)]
for i in range(len(L)-1):
if L[i]!=L[i+1]:
ANS.append(2**i)
print(len(ANS))
print(*ANS)
H20