#P16794. [蓝桥杯 2026 国 B] 生成派生码
[蓝桥杯 2026 国 B] 生成派生码
Problem Description
Xiao Lan is the security administrator of Lanqiao Cloud Course. He is currently responsible for maintaining a set of base verification codes from to . To build a dynamic verification library, he needs to extend these base codes and generate a series of "derived codes".
The process of generating derived codes is as follows: for each base verification code, insert one digit between on the far left, far right, or between any two adjacent digits in its decimal representation, thus forming a new number. Each generation operation can insert only digit, and the newly formed number is a derived code.
During generation, the following rules must be followed:
- Validity: The derived code must be a valid positive integer and must not have leading zeros. For example, the base code cannot form by inserting on the far left, but it can form by inserting on the far right. Inserting in the middle of the digits or on the far right is allowed.
- Uniqueness: All derived codes generated in any way are deduplicated by value. Whether different base codes generate the same derived code, or the same base code generates the same derived code by different insertion positions or different inserted digits, the verification library records it only once.
For example, suppose the base code set contains only the number . The valid derived codes it can produce include:
- Insert on the far left: ( is considered invalid);
- Insert between digits: ;
- Insert on the far right: .
Among them, numbers such as and may be produced multiple times because of different insertion positions, but they are counted only once in the total.
Now, please help Xiao Lan compute: using the base verification codes from to , how many distinct derived codes can be generated in total?
Output Format
This is an output-only fill-in-the-blank problem. You only need to compute the answer and submit it. The result of this problem is an integer. When submitting, you only need to write a program that outputs this integer. Any extra output will result in no points.
Hint
Translated by ChatGPT 5