#P4124. [CQOI2016] 手机号码
[CQOI2016] 手机号码
Description
People prefer mobile phone numbers that are easy to remember or considered lucky. For example, numbers that contain several adjacent identical digits, or numbers that avoid digits with inauspicious homophones. Mobile operators also consider these factors when issuing new numbers and may select numbers with certain features from a number range to sell separately. To aid planning, the operator wants a tool to automatically count how many numbers in a range satisfy certain features.
The tool checks two features: the number must contain at least consecutive identical digits; the number must not contain both and at the same time. A number is valid only if it satisfies both features. Examples that satisfy the conditions: 13000988721, 23333333333, 14444101000. Examples that do not satisfy the conditions: 1015400080, 10010012022.
A mobile phone number has exactly digits and does not have a leading . The tool receives two numbers and and automatically counts how many numbers in the interval satisfy the conditions. and are also -digit mobile phone numbers.
Input Format
The input contains a single line with positive integers separated by a space.
Output Format
Output a single line with integer, the number of valid mobile phone numbers.
12121284000 12121285550
5
Hint
Sample explanation: valid numbers are 12121285000, 12121285111, 12121285222, 12121285333, 12121285550.
Constraints: .
Translated by ChatGPT 5
京公网安备 11011102002149号