#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 20202020 households on this street, and the house numbers are numbered from 11 to 20202020.

Xiao Lan’s method is to first make the digit characters 00 to 99, and then paste the required characters onto each plate. For example, the plate 10171017 needs to paste the characters 1, 0, 1, 7 in order, which means it needs 11 character 0, 22 characters 1, and 11 character 7.

To make all house number plates from 11 to 20202020, 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 11, then the fraction is called a reduced fraction.

For example, 34,52,18,71\frac{3}{4},\frac{5}{2},\frac{1}{8},\frac{7}{1} are all reduced fractions.

How many reduced fractions are there such that both the numerator and the denominator are integers between 11 and 20202020 (including 11 and 20202020)?

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 11.

$\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 55. Please compute what number is in the 2020-th row and the 2020-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 11 kilometer per day. If a day is Monday or the first day of a month (the 1st), then to motivate himself, Xiao Lan runs 22 kilometers. If it is both Monday and the first day of a month, Xiao Lan still runs 22 kilometers.

Xiao Lan has been running for a long time, from Saturday, January 11, 20002000 (inclusive) to Thursday, October 11, 20202020 (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 77 segments that can light up, labeled as a,b,c,d,e,f,ga,b,c,d,e,f,g.

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 bb is lit and all other segments are not lit, it can represent one character.

For example: if c\mathrm{c} 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 a,b,c,d,ea,b,c,d,e are lit and f,gf,g are not lit, it can represent one character.

For example: if b,fb,f 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