← All problemsSign in

Count Digits

CodeChefRating 3199Open on judge ↗

You are given an integer N. For each pair of integers (L, R), where 1 ≤ L ≤ R ≤ N you can find the number of distinct digits that appear in the decimal representation of at least one of the numbers L L+1 ... R. Find the sum of all that numbers. Since the answer can be large, output it modulo 1000000007. Input The only line of the input contains a single integer N without leading zeros. Ou

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start