#P8713. [蓝桥杯 2020 省 A2] 填空问题
[蓝桥杯 2020 省 A2] 填空问题
Problem Description
Task A: Making House Numbers
[Problem Description]
Xiao Lan wants to make house number plates for the residents of a street.
There are 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 needed characters onto each plate. For example, for house number , the characters 1, 0, 1, 7 need to be pasted in order. That is, it needs character 0, characters 1, and character 7.
Question: To make all house number plates from to , how many digit 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 this fraction is called a reduced fraction.
For example, are all reduced fractions.
Question: How many reduced fractions are there such that both the numerator and 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 with 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 calculate what the number in the -th row and -th column is.
[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: Seven-segment Display
[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 light-emitting diodes in the display, labeled .
Xiao Lan wants to choose a subset of diodes (at least one) to light up to represent a character. When designing a character, all lit diodes must be connected as one single piece.
For example, lighting only, with all other diodes off, can represent a character.
For example, lighting only, with all other diodes off, can represent a character. This scheme can represent a different character from the one in the previous line, even though they look similar.
For example, lighting and turning off can represent a character.
For example, lighting only, with all other diodes off, cannot represent a character, because the lit diodes are not connected as one piece.
Question: How many different characters can Xiao Lan represent using the 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.
Task E: Plane Division
[Problem Description]
What is the maximum number of regions the plane can be divided into by circles and straight lines?
[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 a capital letter, indicating which task it is.
Output Format
Output the answer corresponding to the given task letter.
Hint
An answer template is provided 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 for task A
"The answer of task B", // Replace the content in double quotes with the answer for task B
"The answer of task C", // Replace the content in double quotes with the answer for task C
"The answer of task D", // Replace the content in double quotes with the answer for task D
"The answer of task E", // Replace the content in double quotes with the answer for task E
};
char T;
cin >> T;
cout << ans[T - 'A'] << endl;
return 0;
}
Translated by ChatGPT 5