2020 10th C/C++ Group A First Blue Bridge Cup Provincial Match

Here is the topic column of the Blue Bridge Cup over the years. It will be updated successively and the real questions and answers of previous years will be released. I welcome you to follow me. Your likes and attention are the best motivation for me! ! !
The real questions are updated every day, so stay tuned

Blue Bridge Cup real questions and detailed answers over the years


Question 1: Running training

Topic description
Xiao Ming is going to do a running training. Initially, Xiao Ming is full of stamina, and the stamina value is calculated as 10000. If Xiao Ming runs, he will lose 600 stamina per minute. If Xiao Ming rests, increase his stamina by 300 per minute. Both the loss and gain of stamina vary evenly.
Xiao Ming plans to run for one minute, rest for one minute, run for another minute, rest for another minute... and so on. If Xiao Ming's stamina reaches 0 at some point, he stops exercising. May I ask how soon after Xiaoming stops exercising?
To make the answer an integer, output the answer in seconds. Only fill in the number in the answer, not the unit.
topic analysis
topic code



Question 2: Merge Detection

Topic description
The new crown epidemic is caused by the new crown virus, which has recently spread in country A. In order to control the epidemic as soon as possible, country A is preparing to test a large number of people for virus nucleic acid.
However, kits for testing are in short supply. In order to solve this difficulty, scientists have come up with a solution: combined detection. Specimens collected from multiple people (k) will be put into the same kit for testing. If the result is negative, it means that the k individuals are all negative, and the testing of k individuals has been completed with one kit. If the result is positive, it means that at least one person is positive, and all the samples of these k people need to be independently tested again (theoretically, if the k−1 people are all negative before the test, it can be inferred that the kth person is positive, but In practice, this inference will not be used, but k individuals will be tested independently), plus the initial combined testing, a total of k + 1 kits are used to complete the testing of k individuals. Country A estimates that the infection rate of the tested population is about 1%, which is evenly distributed. May I ask how much k can save the most kits?
topic analysis
topic code



Question 3: Distributing masks

Topic description The
mayor of a city has obtained several batches of masks. Given the number of masks in each batch, the mayor should distribute the masks to 2 hospitals in the city. Due to logistical constraints, each batch of masks can only be allocated to one of the hospitals. The mayor wants the difference between the total number of masks received by the two hospitals to be as small as possible. Could you please calculate the minimum difference?
topic analysis
topic code



Question 4: Matrix

Topic Description
Put 1∼2020 in a 2×1010 matrix. It is required that the right side in the same row is larger than the left side, and the lower side in the same column is larger than the upper side. How many options are there in total?
The answer is big, you just need to give the remainder of the number of options divided by 2020.
topic analysis
topic code



Question 5: Perfect Squares

Topic description
If the whole integer X itself is a perfect square, and every digit of it is also a perfect square, we say that X is a perfect square. The first few perfect square numbers are 0, 1, 4, 9, 100, 144...
Could you please calculate the 2020th perfect square number?
topic analysis
topic code



Question 6: Decoding

Title Description
Xiaoming has a long string of English letters, which may contain uppercase and lowercase.
In this string of letters, there are many consecutive repetitions. Xiao Ming thought of a way to make this string of letters shorter: write several consecutive identical letters in the form of letters + the number of occurrences. For example, for five consecutive a's, namely aaaaa, Xiaoming can be abbreviated as a5 (or a4a, aa3a, etc.).
For this example: HHHellllloo, Xiao Ming can be abbreviated as H3el5o2. For the convenience of expression, Xiaoming will not write more than 9 consecutive identical characters in abbreviated form.
Now give the abbreviated string, please help Xiao Ming to restore the original string.
topic analysis
topic code



Question 7: Walk the Square

Problem Description
There are some two-dimensional lattices on a plane.
The numbering of these points is like the numbering of a two-dimensional array. From top to bottom, they are rows 1 to n, and from left to right are columns 1 to m. Each point can be identified by row number and column number. Express. Now there is a person standing in row 1, column 1, going to row n and column m. You can only go right or down.
Note that if the row and column numbers are even, you cannot enter this cell.
Ask how many options are there.
topic analysis
topic code



Question 8: Small splicing of integers

Problem Description
Given an array A1,A2,...,An of length n. You can choose two numbers Ai and Aj (i is not equal to j), and then put Ai and Aj in tandem to form a new integer. For example, 12 and 345 can be spelled 12345 or 34512. Note that swapping the order of Ai and Aj is always treated as 2 spellings, even when Ai=Aj.
Please count the number of spellings that satisfy the spelling of an integer less than or equal to K.
topic analysis
topic code



Question 9: Super glue

Question Description
Xiaoming has n stones, arranged in a row in order. He was going to glue the stones together. Each stone has its own weight, and if two stones are glued together, they will merge into a new stone whose weight is the sum of the weights of the two stones.
In order to ensure that the stones are firmly attached, the glue required for pasting two stones is proportional to the product of the weight of the two stones. This question does not consider the physical unit, and it is believed that the required glue is numerically equal to the product of the weight of the two stones.
Each time he merges, Xiao Ming can only merge two adjacent stones, and place the merged new stone in the original position.
Now, Xiaoming wants to use the least glue to stick all the stones together, please help Xiaoming calculate the minimum amount of glue needed.
topic analysis
topic code



Topic 10: Network Analysis

Topic Description
Xiao Ming is doing a network experiment.
He set up n computers, called nodes, for sending, receiving and storing data.
Initially, all nodes are independent and do not have any connections.
Xiao Ming can connect the two nodes through the network cable, and after the connection, the two nodes can communicate with each other. If two nodes are connected by a network cable, they are called adjacent.
Xiao Ming sometimes tests the network at that time, he will send a message at a certain node, the message will be sent to each adjacent node, and then these nodes will forward to their adjacent nodes, until all the directly or indirectly adjacent nodes. Nodes have received the information. All sending and receiving nodes store the information. A piece of information is only stored once.
Given the process of Xiaoming's connection and testing, please calculate the size of the information stored in each node.
topic analysis
topic code



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324739452&siteId=291194637