赞
踩
模拟即可
#include <bits/stdc++.h> #define int long long //(有超时风险) #define PII pair<int,int> #define endl '\n' #define LL __int128 using namespace std; const int N=2e6+10,M=1e3+10,mod=998244353,INF=0x3f3f3f3f; int a[N],b[N],c[N],pre[N]; signed main() { std::ios::sync_with_stdio(false); std::cin.tie(nullptr); int n;cin>>n; vector<int>ans; while(n) { ans.push_back(n); n/=2; } for(auto i:ans) cout<<i<<' '; return 0; }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。