#P2602. [ZJOI2010] 数字计数

    ID: 1615 远端评测题 1000ms 125MiB 尝试: 9 已通过: 4 难度: 6 上传者: 标签>动态规划,dp递推2010各省省选浙江深度优先搜索,DFS数位 dp

[ZJOI2010] 数字计数

Description

Given two positive integers aa and bb, count how many times each digit appears among all integers in [a,b][a,b].

Input Format

A single line containing two integers a,ba,b, as described above.

Output Format

A single line with ten integers, representing how many times 090\sim 9 appear in [a,b][a,b].

1 99

9 20 20 20 20 20 20 20 20 20

Hint

Constraints and Notes

  • For 30%30\% of the testdata, it is guaranteed that 1ab1061\le a\le b\le10^6.
  • For 100%100\% of the testdata, it is guaranteed that 1ab10121\le a\le b\le 10^{12}.

Translated by ChatGPT 5