結果

問題 No.1871 divisXor
コンテスト
ユーザー inksamurai
提出日時 2022-03-12 00:09:45
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 814 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,358 ms
コンパイル使用メモリ 183,384 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-05 09:25:55
合計ジャッジ時間 5,949 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 4 WA * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
#define int ll
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define rng(i,x,n) for(int i=x;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)a.size()
#define vec(...) vector<__VA_ARGS__>
#define _3HspL4A ios::sync_with_stdio(0),cin.tie(0)
typedef long long ll;
using pii=pair<int,int>;
using vi=vec(int);
void print(){cout<<"\n";}
template<class T,class...E>
void print(const T&v,const E&...u){cout<<v<<' ',print(u...);}
// e 

using vll=vec(ll);

signed main(){
_3HspL4A;
	int n;
	cin>>n;
	if(!n){
		print("-1");
		return 0;
	}
	vll pns;
	per(j,46){
		if(n>>j&1){
			pns.pb(1ll<<j);
			if(j){
				pns.pb(1ll<<(j-1));
			}
		}
	}
	print(sz(pns));
	for(auto v:pns){
		cout<<v<<" ";
	}
// 
	return 0;
}
0