102334: [AtCoder]ABC233 E - Σ[k=0..10^100]floor(X/10^k)
Description
Score : $500$ points
Problem Statement
Find $\displaystyle \sum_{k=0}^{10^{100}} \left \lfloor \frac{X}{10^k} \right \rfloor$.
Notes
$\lfloor A \rfloor$ denotes the value of $A$ truncated to an integer.
Constraints
- $X$ is an integer.
- $1 \le X < 10^{500000}$
Input
Input is given from Standard Input in the following format:
$X$
Output
Print the answer as an integer.
Here, the answer must be precisely printed as an integer, even if it is large. It is not allowed to use exponential notation, such as 2.33e+21
, or print unnecessary leading zeros, as in 0523
.
Sample Input 1
1225
Sample Output 1
1360
The value we seek is $1225+122+12+1+0+0+\dots+0=1360$.
Sample Input 2
99999
Sample Output 2
111105
Beware of carries.
Sample Input 3
314159265358979323846264338327950288419716939937510
Sample Output 3
349065850398865915384738153697722542688574377708317
The values in input and output can both be enormous.
Input
题意翻译
给出一个整数 $x$ ,计算 $\sum^{10^{100}}_{k=0}\lfloor \frac{x}{10^k}\rfloor$ 的值 题目[出处](https://atcoder.jp/contests/abc233/tasks/abc233_e)Output
分数:500分
问题描述
求$\displaystyle \sum_{k=0}^{10^{100}} \left \lfloor \frac{X}{10^k} \right \rfloor$。
注意事项
$\lfloor A \rfloor$表示将$A$截断为整数后的值。
约束条件
- $X$是一个整数。
- $1 \le X < 10^{500000}$
输入
输入通过标准输入给出,格式如下:
$X$
输出
以整数形式打印答案。
即使答案很大,也必须精确地将其打印为整数。不允许使用指数表示法,例如 2.33e+21
,也不允许打印不必要的前导零,例如 0523
。
样例输入 1
1225
样例输出 1
1360
我们要求的值是$1225+122+12+1+0+0+\dots+0=1360$。
样例输入 2
99999
样例输出 2
111105
注意进位。
样例输入 3
314159265358979323846264338327950288419716939937510
样例输出 3
349065850398865915384738153697722542688574377708317
输入和输出的值都可能非常庞大。