結果
問題 |
No.1871 divisXor
|
ユーザー |
![]() |
提出日時 | 2022-03-12 00:09:45 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 814 bytes |
コンパイル時間 | 1,741 ms |
コンパイル使用メモリ | 170,684 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-09-16 04:29:54 |
合計ジャッジ時間 | 7,714 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 4 WA * 25 |
ソースコード
#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; }