#P8760. [蓝桥杯 2021 国 C] 填空问题

[蓝桥杯 2021 国 C] 填空问题

Problem Description

Task A: Integer Range

Problem Description

Use 8-bit binary (one byte) to represent a non-negative integer. If the minimum value that can be represented is 00, then what is the maximum value that can generally be represented?

Answer Submission

This is a fill-in-the-blank question. You only need to calculate the result and submit it. The result of this question is an integer. When submitting the answer, only fill in this integer. If you include extra content, you will not get any score.

Task B: Bandwidth

Problem Description

Xiaolan’s home network bandwidth is 200Mbps200 \mathrm{Mbps}. In theory, what is the maximum amount of content (in MB\mathrm{MB}) that can be downloaded from the Internet per second using Xiaolan’s network?

Answer Submission

This is a fill-in-the-blank question. You only need to calculate the result and submit it. The result of this question is an integer. When submitting the answer, only fill in this integer. If you include extra content, you will not get any score.

Task C: Pure Primes

Problem Description

If a positive integer has only two divisors, 11 and itself, then it is called a prime number.

The first few primes are: 2,3,5,7,11,13,17,19,23,29,31,37,2,3,5,7,11,13,17,19,23,29,31,37,\cdots.

If all decimal digits of a prime number are also prime digits, we call it a pure prime. For example, 2,3,5,7,23,372,3,5,7,23,37 are pure primes, while 11,13,17,19,29,3111,13,17,19,29,31 are not pure primes. Of course, 1,4,351,4,35 are also not pure primes.

Question: Between 11 and 2021060520210605, how many pure primes are there?

Answer Submission

This is a fill-in-the-blank question. You only need to calculate the result and submit it. The result of this question is an integer. When submitting the answer, only fill in this integer. If you include extra content, you will not get any score.

Task D: Perfect Dates

Problem Description

If, for a date, the sum of all digits in its year, month, and day is a perfect square, then it is called a perfect date.

For example, for June 55, 20212021, the sum of digits is 2+0+2+1+6+5=162+0+2+1+6+5=16, and 1616 is a perfect square, which is the square of 44. So June 55, 20212021 is a perfect date.

For example, for June 2323, 20212021, the sum of digits is 2+0+2+1+6+2+3=162+0+2+1+6+2+3=16, which is also a perfect square. So June 2323, 20212021 is also a perfect date.

Question: From January 11, 20012001 to December 3131, 20212021, how many perfect dates are there in total?

Answer Submission

This is a fill-in-the-blank question. You only need to calculate the result and submit it. The result of this question is an integer. When submitting the answer, only fill in this integer. If you include extra content, you will not get any score.

Task E: Minimum Weight

Problem Description

For a rooted binary tree TT, Xiaolan defines the weight W(T)W(T) of this tree’s nodes as follows:

The weight of an empty subtree is 00.

If a node vv has a left subtree LL and a right subtree RR, with C(L)C(L) and C(R)C(R) nodes respectively, then:

W(v)=1+2W(L)+3W(R)+(C(L))2C(R)W(v)=1+2 W(L)+3 W(R)+(C(L))^{2} C(R).

The weight of the tree is defined as the weight of the root node.

Xiaolan wants to know: for a binary tree with 20212021 nodes, what is the minimum possible weight of the tree?

Answer Submission

This is a fill-in-the-blank question. You only need to calculate the result and submit it. The result of this question is an integer. When submitting the answer, only fill in this integer. If you include extra content, you will not get any score.

Input Format

Input one uppercase letter, indicating which task it is.

Output Format

According to the input task label, output the answer corresponding to that task.

Hint

Answer template, for reference.

#include<iostream>
using namespace std;
int main() {
    string ans [] = {
        "The answer of task A", // Replace inside the quotes with the answer for task A
        "The answer of task B", // Replace inside the quotes with the answer for task B
        "The answer of task C", // Replace inside the quotes with the answer for task C
        "The answer of task D", // Replace inside the quotes with the answer for task D
        "The answer of task E", // Replace inside the quotes with the answer for task E
    };
    char T;
    cin >> T;
    cout << ans[T - 'A'] << endl;
    return 0;
}

Translated by ChatGPT 5