#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 . If Xiaoming runs, he loses stamina per minute. If Xiaoming rests, he gains 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 , 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, is the 99th anniversary of the establishment of ×××××.
××××× was established on July 23, .
Ask how many minutes are included in total from 12:00 noon on July 23, to 12:00 noon on July 1, .
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 . In order to control the outbreak as soon as possible, country 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 ( people) are put into the same test kit for testing. If the result is negative, it means these people are all negative, and one test kit completes testing for people. If the result is positive, it means at least one person is positive, and the samples of all people need to be retested independently (in theory, if the first people are negative, it can be inferred that the -th person is positive, but in practice this inference will not be used, and the people will be tested independently). Including the initial pooled test, a total of test kits are used to complete testing for people.
Country estimates that the infection rate among the tested people is about , uniformly distributed. Ask what value of 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 represents a loop that repeats 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 to the one containing are all inside the first line's loop that repeats twice.
The lines from the one containing REPEAT 6: to the one containing are all inside the REPEAT 5: loop.
The statement is actually executed a total of times.
After the program finishes executing, what is the value of ?
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 into a 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 .
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