记数问题
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.
说明
试计算在区间 1 到 n 的所有整数中,数字 x(0 ≤ x ≤ 9)共出现了多少次?例如,在 1 到 11 中,即在 1、2、3、4、5、6、7、8、9、10、11 中,数字 1 出现了 4 次。
输入格式
输入共 1 行,包含 2 个整数 n、x,之间用一个空格隔开输出格式
输出共 1 行,包含一个整数,表示 x 出现的次数.样例
11 1
4
提示
对于 100%的数据,1≤ n ≤ 1,000,000,0 ≤ x ≤ 9。二级模拟题
- Status
- Done
- Rule
- ACM/ICPC
- Problem
- 6
- Start at
- 2025-3-21 15:30
- End at
- 2025-3-21 17:30
- Duration
- 2 hour(s)
- Host
- Partic.
- 0