当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

6796:X Number

题目描述
Teitoku loves many different kinds of numbers, and today Little W wants him to classify some positive integers into different categories.

There are $11$ categories, numbered from $0$ to $10$. For each positive integer $x$, if there exists only one type of digit $d$ $(0 \leq d \leq 9)$ that occurs in $x$ with the highest frequency, then we say $x$ should be classified into category $d$, or otherwise, in case such digit doesn't exist, we say $x$ should be classified into category $10$.

For example,

    ● $111223$ should be classified into category $1$ since digit $1$ occurs three times, and digits $2$ and $3$ occur less than three times respectively, and
    ● $3345544$ should be classified into category $4$ since digit $4$ occurs three times, and digits $3$ and $5$ occur less than three times respectively, and
    ● $112233$ should be classified into category $10$ since digits $1$, $2$ and $3$ occur twice respectively.

Little W doesn't care about category $10$ and he just wants Teitoku to tell him the number of integers ranged from $l$ to $r$ that should be classified to another category $d$. However, Teitoku can hardly solve this problem, so he asks you for help.
输入解释
There are several test cases.

The first line contains an integer $T$ $(1 \leq T \leq 1000)$, denoting the number of test cases. Then follow all the test cases.

For each test case, the only line contains three integers $l$, $r$ and $d$ $(1 \leq l \leq r \leq 10^{18}, 0 \leq d \leq 9)$, representing a problem.
输出解释
For each test case, output in one line the number of integers ranged from $l$ to $r$ that should be classified to category $d$.
输入样例
3
1 10 1
1 11 1
1 100 0
输出样例
1
2
1
提示
For the sample cases, 1 and 11 are in category 1, 100 is in category 0 and 10 is in category 10.
来自杭电HDUOJ的附加信息
Recommend liuyiding

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-6796

最后修改于 2020-10-25T23:34:26+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
3000/3000MS(Java/Others) 524288/524288K(Java/Others)