#P8705. [蓝桥杯 2020 省 B1] 填空问题

[蓝桥杯 2020 省 B1] 填空问题

Problem Description

Task A: Running Training

Problem Description

Xiaoming is going to do a running training session.

At the beginning, Xiaoming is full of energy, and his stamina is 1000010000. If Xiaoming runs, he loses 600600 stamina per minute. If Xiaoming rests, he gains 300300 stamina per minute. The loss and gain of stamina both change uniformly.

Xiaoming plans to run for one minute, rest for one minute, then run for one minute, then rest for one minute... repeating this cycle. If at some moment Xiaoming's stamina reaches 00, he stops training. Ask how long it takes before Xiaoming stops training.

To make the answer an integer, output the answer in seconds. Only fill in the number in the answer, without writing the unit.

Answer Submission

This is a result fill-in problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will not receive points.

Task B: Anniversary

Problem Description

July 1, 20202020 is the 99th anniversary of the establishment of ×××××.

××××× was established on July 23, 19211921.

Ask how many minutes are included in total from 12:00 noon on July 23, 19211921 to 12:00 noon on July 1, 20202020.

Answer Submission

This is a result fill-in problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will not receive points.

Task C: Pooled Testing

Problem Description

COVID-19 is caused by the coronavirus. Recently it has been spreading in country A\mathrm{A}. In order to control the outbreak as soon as possible, country A\mathrm{A} plans to perform viral nucleic acid tests on a large number of people.

However, test kits are in short supply.

To solve this difficulty, scientists came up with an idea: pooled testing. That is, samples collected from multiple people (kk people) are put into the same test kit for testing. If the result is negative, it means these kk people are all negative, and one test kit completes testing for kk people. If the result is positive, it means at least one person is positive, and the samples of all kk people need to be retested independently (in theory, if the first k1k-1 people are negative, it can be inferred that the kk-th person is positive, but in practice this inference will not be used, and the kk people will be tested independently). Including the initial pooled test, a total of k+1k+1 test kits are used to complete testing for kk people.

Country A\mathrm{A} estimates that the infection rate among the tested people is about 1%1 \%, uniformly distributed. Ask what value of kk saves the most test kits.

Answer Submission

This is a result fill-in problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will not receive points.

Task D: REPEAT Program

Problem Description

In the attached file prog.txt, there is a program written in some language.

Here, REPEAT kk represents a loop that repeats kk times. The range controlled by the loop is expressed by indentation: starting from the next line, consecutive lines whose indentation is deeper than that line (with longer leading whitespace) are the content included in the loop.

For example, the following snippet:

REPEAT 2:
    A=A+4
    REPEAT 5:
        REPEAT 6:
            A=A+5
        A=A+7
    A=A+8
A=A+9

In this snippet, the lines from the one containing A=A+4A=A+4 to the one containing A=A+8A=A+8 are all inside the first line's loop that repeats twice.

The lines from the one containing REPEAT 6: to the one containing A=A+7A=A+7 are all inside the REPEAT 5: loop.

The statement A=A+5A=A+5 is actually executed a total of 2×5×6=602 \times 5 \times 6=60 times.

After the program finishes executing, what is the value of A\mathrm{A}?

Answer Submission

This is a result fill-in problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will not receive points.

Task E: Matrix

Problem Description

Place 120201 \sim 2020 into a 2×10102 \times 1010 matrix. It is required that in the same row, the number on the right is larger than the number on the left, and in the same column, the number on the bottom is larger than the number on the top. How many valid arrangements are there in total?

The answer is very large. You only need to output the remainder when the number of arrangements is divided by 20202020.

Answer Submission

This is a result fill-in problem. You only need to calculate the result and submit it. The result of this problem is an integer. When submitting, only fill in this integer. Any extra content will not receive points.

Input Format

Input a capital 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 inside the double quotes with the answer to task A
        "The answer of task B", // Replace inside the double quotes with the answer to task B
        "The answer of task C", // Replace inside the double quotes with the answer to task C
        "The answer of task D", // Replace inside the double quotes with the answer to task D
        "The answer of task E", // Replace inside the double quotes with the answer to task E
    };
    char T;
    cin >> T;
    cout << ans[T - 'A'] << endl;
    return 0;
}

Translated by ChatGPT 5