P2602 [ZJOI2010] Digit Counting
Description
Given two positive integers $a$ and $b$, count how many times each digit appears among all integers in $[a,b]$.
Input Format
A single line containing two integers $a,b$, as described above.
Output Format
A single line with ten integers, representing how many times $0\sim 9$ appear in $[a,b]$.
Explanation/Hint
#### Constraints and Notes
- For $30\%$ of the testdata, it is guaranteed that $1\le a\le b\le10^6$.
- For $100\%$ of the testdata, it is guaranteed that $1\le a\le b\le 10^{12}$.
Translated by ChatGPT 5