Problem 3784 --Digits Sum

3784: Digits Sum

"
Time Limit $1$ 秒/Second(s) Memory Limit $128$ 兆字节/Megabyte(s)
提交总数 $33$ 正确数量 $17$
裁判形式 标准裁判/Standard Judge 我的状态 尚未尝试
难度 分类标签

Let's define S(x) to be the sum of digits of number x written in decimal system. For example, S(5)=5S(10)=1S(322)=7.

We will call an integer x interesting if S(x+1)<S(x). In each test you will be given one integer n. Your task is to calculate the number of integers x such that 1≤x≤n and x is interesting.

The first line contains one integer t (1≤t≤1000)  — number of test cases.

Then t lines follow, the i-th line contains one integer n (1≤n≤109) for the i-th test case.

Print t integers, the i-th should be the answer for the i-th test case.
5
1
9
10
34
880055535
0
1
1
3
88005553
The first interesting number is equal to 9.

推荐代码 查看3784 所有题解 上传题解视频得图灵币

本题记录 用 户(点击查看用户) 运行号(点击购买题解) 时 间
算法最快[$0 $ms] 只能过个样例~~~ 761322 2021-07-24 20:15:58
内存最少[$2080 $KB] 我想睡觉 803049 2021-12-24 12:56:25
第一AC 只能过个样例~~~ 761322 2021-07-24 20:15:58
第一挑战 只能过个样例~~~ 761322 2021-07-24 20:15:58

赛题来源/所属竞赛 N/A

竞赛编号 竞赛名称 竞赛时间 访问比赛
1671 2021年下学年第12周周赛 2021-11-20 19:00:00 请登录