ABC 195 C

た 入场券 2024-03-17 15:40 152阅读 0赞

不知道该怎么解释这道题,反正我不太会,感觉很帅

题意:

5ea04594676f4a78a31bec299de61d1a.png

Code:

  1. #include <bits/stdc++.h>
  2. #define int long long
  3. using namespace std;
  4. const int mxn=2e3+10;
  5. const int mxe=2e5+10;
  6. const int mod=1e9+7;
  7. const int Inf=1e18;
  8. int N;
  9. void solve(){
  10. cin>>N;
  11. int w=1000;
  12. int ans=0;
  13. while(w<=N){
  14. ans+=N-w+1;
  15. w*=1000;
  16. }
  17. cout<<ans<<'\n';
  18. }
  19. signed main(){
  20. ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
  21. int __=1;//cin>>__;
  22. while(__--)solve();return 0;
  23. }

发表评论

表情:
评论列表 (有 0 条评论,152人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Atcoder ABC 139C

    Atcoder ABC 139C 题意: > 有 $ n $ 个正方形,选择一个起始位置,使得从这个位置向右的小于等于这个正方形的高度的数量最多。 解法...

    相关 ABC 195 C

    不知道该怎么解释这道题,反正我不太会,感觉很帅 题意: ![5ea04594676f4a78a31bec299de61d1a.png][] Code: incl