#P16794. [蓝桥杯 2026 国 B] 生成派生码

    ID: 19135 远端评测题 1000ms 512MiB 尝试: 0 已通过: 0 显示难度普及 上传者: 标签>提交答案数位 DP2026蓝桥杯国赛

[蓝桥杯 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 11 to 2026060620260606. 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 090 \sim 9 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 11 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 11 cannot form 0101 by inserting 00 on the far left, but it can form 1010 by inserting 00 on the far right. Inserting 00 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 1212. The valid derived codes it can produce include:

  • Insert on the far left: 112,212,,912112, 212, \dots, 912 (012012 is considered invalid);
  • Insert between digits: 102,112,122,,192102, 112, 122, \dots, 192;
  • Insert on the far right: 120,121,122,,129120, 121, 122, \dots, 129.

Among them, numbers such as 112112 and 122122 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 11 to 2026060620260606, 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