Type: Default 1000ms 256MiB

数1的个数

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

【题目描述】

给定一个十进制正整数 nn1n1041\leq n\leq 10^4),写下从 11nn 的所有整数,然后数一下其中出现的数字 1 的个数。

例如当 n=2n=2 时,写下 1,21,2。这样只出现了 111;当 n=12n=12时,写下 1,2,10,11,121,2,\dots 10,11,12。这样出现了 551

【输入】

正整数 nn1n1041\leq n\leq 10^4

【输出】

一个正整数,即 1 的个数。

【输入样例】

12

【输出样例】

5

【来源】

一本通在线评测

1219签到加作业

Not Attended
Status
Done
Rule
IOI
Problem
7
Start at
2025-12-19 10:00
End at
2025-12-19 12:15
Duration
2.3 hour(s)
Host
Partic.
44