#P8740. [蓝桥杯 2021 省 A] 填空问题

[蓝桥杯 2021 省 A] 填空问题

Problem Description

Task A: Cards

Problem Description

Xiao Lan has many digit cards. Each card has a digit from 00 to 99 on it.

Xiao Lan plans to use these cards to form some numbers. He wants to form positive integers starting from 11. After forming a number, he keeps it, and the cards used for it cannot be used to form other numbers.

Xiao Lan wants to know how far he can form numbers starting from 11.

For example, when Xiao Lan has 3030 cards, with 33 cards for each digit from 00 to 99, Xiao Lan can form 11 to 1010. But when forming 1111, he has only one card with digit 11 left, which is not enough to form 1111.

Now Xiao Lan has 20212021 cards for each digit from 00 to 99, a total of 2021020210 cards. Up to what number can Xiao Lan form starting from 11?

Hint: It is recommended to solve this problem using computer programming.

Answer Submission

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will result in no score.

Task B: Lines

Problem Description

In the Cartesian coordinate system, two points determine a line. If multiple points lie on the same line, then the line determined by any two of these points is the same line.

Given 2×32 \times 3 lattice points on the plane $\{(x,y) \mid 0 \leq x<2,0 \leq y<3,x \in \mathbb{Z},y \in \mathbb{Z}\}$, i.e., points whose xx-coordinate is an integer between 00 and 11 (including 00 and 11), and whose yy-coordinate is an integer between 00 and 22 (including 00 and 22). These points determine 1111 distinct lines in total.

Given 20×2120 \times 21 lattice points on the plane $\{(x,y) \mid 0 \leq x<20,0 \leq y<21,x \in \mathbb{Z},y \in \mathbb{Z}\}$, i.e., points whose xx-coordinate is an integer between 00 and 1919 (including 00 and 1919), and whose yy-coordinate is an integer between 00 and 2020 (including 00 and 2020). How many distinct lines do these points determine in total?

Answer Submission

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will result in no score.

Task C: Cargo Placement

Problem Description

Xiao Lan has a super large warehouse that can store many goods.

Now, Xiao Lan has nn boxes of goods to place in the warehouse. Each box is a regular cube. Xiao Lan defines three mutually perpendicular directions: length, width, and height. The edges of each box must be strictly parallel to the length, width, and height directions.

Xiao Lan hopes that all the goods will finally be stacked into one large cuboid. That is, stack LL, WW, and HH boxes along the length, width, and height directions respectively, satisfying n=L×W×Hn=L \times W \times H.

Given nn, how many stacking plans meet the requirement?

For example, when n=4n=4, there are 66 plans: $1 \times 1 \times 4 、 1 \times 2 \times 2 、 1 \times 4 \times 1 、 2 \times 1 \times 2$ 、 2×2×14×1×12 \times 2 \times 1 、 4 \times 1 \times 1.

When n=2021041820210418n=2021041820210418 (note that it has 1616 digits), how many plans are there in total?

Hint: It is recommended to solve this problem using computer programming.

Answer Submission

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will result in no score.

Task D: Path

Problem Description

After learning shortest paths, Xiao Lan is very happy. He defined a special graph and wants to find the shortest path in this graph.

Xiao Lan's graph consists of 20212021 nodes, numbered from 11 to 20212021 in order.

For two different nodes a,ba,b, if the absolute value of the difference between aa and bb is greater than 2121, then there is no edge between them. If the absolute value of the difference between aa and bb is less than or equal to 2121, then there is an undirected edge between them with length equal to the least common multiple of aa and bb.

For example, there is no edge between node 11 and node 2323. There is an undirected edge between node 33 and node 2424 with length 2424. There is an undirected edge between node 1515 and node 2525 with length 7575.

Compute the length of the shortest path between node 11 and node 20212021.

Hint: It is recommended to solve this problem using computer programming.

Answer Submission

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will result in no score.

Task E: Cycle Counting

Problem Description

Lanqiao Academy has 2121 teaching buildings, numbered from 11 to 2121. For two buildings aa and bb, when aa and bb are coprime, there is a corridor directly connecting them, and it can be traveled in both directions. Otherwise, there is no corridor directly connecting them.

Xiao Lan is now in building 11. He wants to visit each building exactly once and finally return to building 11 (i.e., walk along a Hamiltonian cycle). How many different visiting plans does he have? Two visiting plans are considered different if there exists some ii such that after visiting building ii, Xiao Lan visits different next buildings in the two plans.

Hint: It is recommended to solve this problem using computer programming.

Answer Submission

This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will result in no score.

Input Format

Input one uppercase letter, indicating which task it is.

Output Format

According to the input task letter, output the answer for the corresponding task.

Hint

Answer template for reference.

#include<iostream>
using namespace std;
int main() {
    string ans [] = {
        "The answer of task A", // Replace the content in double quotes with the answer to task A.
        "The answer of task B", // Replace the content in double quotes with the answer to task B.
        "The answer of task C", // Replace the content in double quotes with the answer to task C.
        "The answer of task D", // Replace the content in double quotes with the answer to task D.
        "The answer of task E", // Replace the content in double quotes with the answer to task E.
    };
    char T;
    cin >> T;
    cout << ans[T - 'A'] << endl;
    return 0;
}

Translated by ChatGPT 5