#P8740. [蓝桥杯 2021 省 A] 填空问题
[蓝桥杯 2021 省 A] 填空问题
Problem Description
Task A: Cards
Problem Description
Xiao Lan has many digit cards. Each card has a digit from to on it.
Xiao Lan plans to use these cards to form some numbers. He wants to form positive integers starting from . 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 .
For example, when Xiao Lan has cards, with cards for each digit from to , Xiao Lan can form to . But when forming , he has only one card with digit left, which is not enough to form .
Now Xiao Lan has cards for each digit from to , a total of cards. Up to what number can Xiao Lan form starting from ?
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 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 -coordinate is an integer between and (including and ), and whose -coordinate is an integer between and (including and ). These points determine distinct lines in total.
Given 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 -coordinate is an integer between and (including and ), and whose -coordinate is an integer between and (including and ). 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 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 , , and boxes along the length, width, and height directions respectively, satisfying .
Given , how many stacking plans meet the requirement?
For example, when , there are plans: $1 \times 1 \times 4 、 1 \times 2 \times 2 、 1 \times 4 \times 1 、 2 \times 1 \times 2$ 、 .
When (note that it has 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 nodes, numbered from to in order.
For two different nodes , if the absolute value of the difference between and is greater than , then there is no edge between them. If the absolute value of the difference between and is less than or equal to , then there is an undirected edge between them with length equal to the least common multiple of and .
For example, there is no edge between node and node . There is an undirected edge between node and node with length . There is an undirected edge between node and node with length .
Compute the length of the shortest path between node and node .
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 teaching buildings, numbered from to . For two buildings and , when and 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 . He wants to visit each building exactly once and finally return to building (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 such that after visiting building , 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