Files
python/TangDou/ShuLun/SL11_数位递增数.txt
HuangHai 1f397eca87 'commit'
2025-08-30 18:35:01 +08:00

17 lines
663 B
Plaintext
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

问题描述
  一个正整数如果任何一个数位不大于右边相邻的数位,则称为一个数位递增的数,
例如1135是一个数位递增的数而1024不是一个数位递增的数。
  给定正整数 n请问在整数 1 至 n 中有多少个数位递增的数?
输入格式
  输入的第一行包含一个整数 n。
输出格式
  输出一行包含一个整数,表示答案。
样例输入
30
样例输出
26
评测用例规模与约定
  对于 40% 的评测用例1 <= n <= 1000。
  对于 80% 的评测用例1 <= n <= 100000。
  对于所有评测用例1 <= n <= 1000000。