#P8714. [蓝桥杯 2020 省 B2] 填空问题
[蓝桥杯 2020 省 B2] 填空问题
Problem Description
Task A: House Number Plate Making
Problem Description
Xiao Lan wants to make house number plates for the residents on a street.
There are a total of households on this street, and the house numbers are numbered from to .
Xiao Lan’s method is to first make the digit characters to , and then paste the required characters onto each plate. For example, the plate needs to paste the characters 1, 0, 1, 7 in order, which means it needs character 0, characters 1, and character 7.
To make all house number plates from to , how many characters 2 are needed in total?
Answer Submission
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result is an integer. When submitting, only fill in this integer; any extra content will not be scored.
Task B: Reduced Fractions
Problem Description
If the greatest common divisor of the numerator and denominator of a fraction is , then the fraction is called a reduced fraction.
For example, are all reduced fractions.
How many reduced fractions are there such that both the numerator and the denominator are integers between and (including and )?
Answer Submission
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result is an integer. When submitting, only fill in this integer; any extra content will not be scored.
Task C: Snake-like Filling
Problem Description
As shown in the figure below, Xiao Ming fills an infinite matrix in a “snake-like” pattern using positive integers starting from .
$\begin{array}{cccccc}1 & 2 & 6 & 7 & 15 & \ldots \\ 3 & 5 & 8 & 14 & \ldots & \\ 4 & 9 & 13 & \ldots & & \\ 10 & 12 & \ldots & & & \\ 11 & \ldots & & & & \\ \ldots & & & & & \end{array}$
It is easy to see that the number in the second row and second column is . Please compute what number is in the -th row and the -th column of the matrix.
Answer Submission
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result is an integer. When submitting, only fill in this integer; any extra content will not be scored.
Task D: Running Exercise
Problem Description
Xiao Lan exercises every day.
Normally, Xiao Lan runs kilometer per day. If a day is Monday or the first day of a month (the 1st), then to motivate himself, Xiao Lan runs kilometers. If it is both Monday and the first day of a month, Xiao Lan still runs kilometers.
Xiao Lan has been running for a long time, from Saturday, January , (inclusive) to Thursday, October , (inclusive). How many kilometers did Xiao Lan run in total during this period?
Answer Submission
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result is an integer. When submitting, only fill in this integer; any extra content will not be scored.
Task E: Seven-Segment Code
Problem Description
Xiao Lan wants to use a seven-segment display to represent a special kind of characters.

The figure above shows a diagram of a seven-segment display. There are segments that can light up, labeled as .
Xiao Lan wants to select some segments (at least one) to light up to represent a character. When designing the representation, all lit segments are required to form one connected component.
For example: if is lit and all other segments are not lit, it can represent one character.
For example: if is lit and all other segments are not lit, it can represent one character. This scheme can represent a different character from the one in the previous line, even though they look quite similar.
For example: if are lit and are not lit, it can represent one character.
For example: if are lit and all other segments are not lit, then it cannot represent a character, because the lit segments are not connected.
How many different characters can Xiao Lan represent using a seven-segment display?
Answer Submission
This is a fill-in-the-blank question. You only need to compute the result and submit it. The result is an integer. When submitting, only fill in this integer; any extra content will not be scored.
Input Format
Input one uppercase letter, indicating which task it is.
Output Format
According to the input task letter, output the corresponding answer.
Hint
Answer template for reference.
#include<iostream>
using namespace std;
int main() {
string ans [] = {
"The answer of task A", // Replace the content in quotes with the answer to task A
"The answer of task B", // Replace the content in quotes with the answer to task B
"The answer of task C", // Replace the content in quotes with the answer to task C
"The answer of task D", // Replace the content in quotes with the answer to task D
"The answer of task E" // Replace the content in quotes with the answer to task E
};
char T;
cin >> T;
cout << ans[T - 'A'] << endl;
return 0;
}
Translated by ChatGPT 5