当前位置:   article > 正文

P8711 [蓝桥杯 2020 省 B1] 整除序列--2024冲刺蓝桥杯省一

P8711 [蓝桥杯 2020 省 B1] 整除序列--2024冲刺蓝桥杯省一

点击跳转例题

模拟即可

  1. #include <bits/stdc++.h>
  2. #define int long long //(有超时风险)
  3. #define PII pair<int,int>
  4. #define endl '\n'
  5. #define LL __int128
  6. using namespace std;
  7. const int N=2e6+10,M=1e3+10,mod=998244353,INF=0x3f3f3f3f;
  8. int a[N],b[N],c[N],pre[N];
  9. signed main()
  10. {
  11. std::ios::sync_with_stdio(false);
  12. std::cin.tie(nullptr);
  13. int n;cin>>n;
  14. vector<int>ans;
  15. while(n)
  16. {
  17. ans.push_back(n);
  18. n/=2;
  19. }
  20. for(auto i:ans)
  21. cout<<i<<' ';
  22. return 0;
  23. }

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/数据灵魂/article/detail/60566
推荐阅读
相关标签
  

闽ICP备14008679号