CSES Removing Digits
// compile: make data
// run: ./data < data.in
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#ifdef LOCAL
#include <debug/codeforces.h>
#define debug(x...) _debug_print(#x, x);
#define Debug(x...) _debug_print_format(#x, x);
std::ifstream terminal("/dev/tty");
#define PP cerr<<"\033[1;30mpause...\e[0m",terminal.ignore();
#else
#define debug(x...)
#define Debug(x...)
#define PP
#endif
template<typename...Args> void print_(Args...args){((cout<<args<<" "),...)<<endl;}
#define VI vector<int>
#define VII vector<vector<int>>
#define VIII vector<vector<vector<int>>>
#define rep(i,a,b) for(int i=(a);i<(int)(b);++i)
#define sz(v) ((int)(v).size())
#define print(...) print_(__VA_ARGS__);
#define FIND(a, x) ((find(a.begin(),a.end(),(x))!=a.end())?1:0)
#define cmin(x,...) x=min({(x), __VA_ARGS__})
#define cmax(x,...) x=max({(x), __VA_ARGS__})
#define INTMAX (int)(9223372036854775807)
#define INF (int)(1152921504606846976)
#define NaN (int)(0x8b88e1d0595d51d1)
#define double long double
#define int long long
#define uint unsigned long long
#define MAXN 200010

int32_t main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);

    int m; cin >> m;
    vector<int> dp(m+1, INF);
    dp[m] = 0;
    for (int i = m; i > 0; --i) {
        vector<int> v;
        for (int x = i; x; x /= 10) v.push_back(x % 10);
        for (int x: v) {
            if (i - x >= 0) cmin(dp[i-x], dp[i] + 1);
        }
    }
    cout << dp[0] << endl;

    return 0;
}

Comments

  1. 11 months ago
    2025-12-06 2:35:20

    Hey all. Just logged in to 789tayalogin and the experience was smooth. No hiccups, easy to navigate. Check it out if you’re interested! 789tayalogin

  2. 11 months ago
    2025-12-19 13:50:29

    Hey all, anyone checking out gà chọi c1.com trực tiếp? Let me know what you think! Always on the lookout for the best places to watch.

  3. 10 months ago
    2025-12-29 6:18:48

    Just dropping in to say 181bet4 has some serious odds on upcoming matches. I just placed a few bets. Let’s hope they pay off !

  4. 8 months ago
    2026-3-02 19:50:07

    Grab the 755betapp fast! Easy to download and gives you all the betting action you could want.

  5. 8 months ago
    2026-3-02 19:50:23

    Hey, 999taya’s been my go-to lately. Easy to use and I’ve actually had some decent luck! Give it a shot, might surprise ya. Check it out 999taya!

  6. 8 months ago
    2026-3-02 19:50:39

    555taya777, man, this one’s got a funky name but surprisingly solid games. Tried it last night and walked away with a few extra bucks. Worth a look! Find it here: 555taya777.

  7. 2 months ago
    2026-9-06 11:57:52

    Had an amazing experience winning big here last weekend! The customer support was very helpful when I had questions about the withdrawal. Love vnhitclubwin.

  8. 2 months ago
    2026-9-13 9:29:44

    The game variety here is insane. I spent the whole weekend exploring different slots and the bonuses are actually fair. Check out ve88game for a great time.

  9. 2 months ago
    2026-9-14 8:03:25

    The game selection is fantastic and I have had some lucky wins here recently. It is a very entertaining platform. Go for bundaslotlogin.

  10. 1 month ago
    2026-9-23 11:03:41

    The app installation was seamless and the performance is top-notch. No lags during the big wins which is exactly what I need. Download it via jili979download.

  11. 1 month ago
    2026-9-24 12:38:27

    I’ve been playing here for a few weeks now and the interface is super smooth. Really enjoying the variety of games available. Check out vngamef188 for a great experience!

  12. 1 month ago
    2026-10-02 22:13:08

    The variety of games available is impressive. I really appreciate how stable the platform is even during peak hours. Check out vnh13game if you want a reliable place to play.

  13. 1 month ago
    2026-10-03 16:59:17

    Great customer support and very quick withdrawals. It makes the whole gaming experience stress-free. Big thanks to vnpl88.

Send Comment Edit Comment


				
|´・ω・)ノ
ヾ(≧∇≦*)ゝ
(☆ω☆)
(╯‵□′)╯︵┴─┴
 ̄﹃ ̄
(/ω\)
∠( ᐛ 」∠)_
(๑•̀ㅁ•́ฅ)
→_→
୧(๑•̀⌄•́๑)૭
٩(ˊᗜˋ*)و
(ノ°ο°)ノ
(´இ皿இ`)
⌇●﹏●⌇
(ฅ´ω`ฅ)
(╯°A°)╯︵○○○
φ( ̄∇ ̄o)
ヾ(´・ ・`。)ノ"
( ง ᵒ̌皿ᵒ̌)ง⁼³₌₃
(ó﹏ò。)
Σ(っ °Д °;)っ
( ,,´・ω・)ノ"(´っω・`。)
╮(╯▽╰)╭
o(*////▽////*)q
>﹏<
( ๑´•ω•) "(ㆆᴗㆆ)
😂
😀
😅
😊
🙂
🙃
😌
😍
😘
😜
😝
😏
😒
🙄
😳
😡
😔
😫
😱
😭
💩
👻
🙌
🖕
👍
👫
👬
👭
🌚
🌝
🙈
💊
😶
🙏
🍦
🍉
😣
Source: github.com/k4yt3x/flowerhd
颜文字
Emoji
小恐龙
花!
Previous
Next