CF1570D
题目传送门 & CF 传送门
思路
这题做不了,所以只有一个人通过了。
这题只要纯模拟就行了。不难发现,这题中的
代码
# include <bits/stdc++.h>
using namespace std;
int n, tot;
bool vis[15];
int main () {
cin >> n;
while (1) {
++ n, ++ tot;
while (! (n % 10))
n /= 10;
if (n < 10) {
if (vis[n]) {
cout << tot;
return 0;
}
vis[n] = 1;
}
}
}