#P8758. [蓝桥杯 2021 国 A] 填空问题

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

Problem Description

Task A: Pure Prime

Problem Description

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

The first few prime numbers 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 themselves 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.

In the range from 11 to 2021060520210605, how many pure primes are there?

Answer Submission

This is a result fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer. Any extra content will cause you to receive no score.

Task B: Perfect Date

Problem Description

If, in a date, the sum of all digits in the year, month, and day is a perfect square, then this date 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 because it is 44 squared. 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.

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

Answer Submission

This is a result fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer. Any extra content will cause you to receive no score.

Task C: Minimum Weight

Problem Description

For a rooted binary tree TT, Xiaolan defines the weight W(T)W(T) of this tree 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 its 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 result fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer. Any extra content will cause you to receive no score.

Task D: Covering

Problem Description

Xiaolan has a chessboard of size 8×88 \times 8, consisting of 88 rows and 88 columns, for a total of 6464 squares. There is a beautiful pattern on the board, so after rotating the board, it is different from the original board.

Xiaolan has many identical paper pieces. Each piece can cover exactly two adjacent squares on the board. Xiaolan wants to use 3232 pieces to cover the board completely, with each piece covering two squares.

Xiaolan found that there are many ways to do such a covering. If the board is relatively small, the number of ways is easier to compute. For example, when the board is 2×22 \times 2, there are 22 ways; when the board is 4×44 \times 4, there are 3636 ways. However, Xiaolan cannot figure out how many covering ways there are for his own 8×88 \times 8 board.

Please help Xiaolan compute the total number of covering ways for this 8×88 \times 8 board.

Answer Submission

This is a result fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer. Any extra content will cause you to receive no score.

Hint: It is recommended to use a computer to compute it. The answer is an 88-digit decimal integer.

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", // 双引号中替换为 A 题的答案
        "The answer of task B", // 双引号中替换为 B 题的答案
        "The answer of task C", // 双引号中替换为 C 题的答案
        "The answer of task D", // 双引号中替换为 D 题的答案
    };
    char T;
    cin >> T;
    cout << ans[T - 'A'] << endl;
    return 0;
}

Translated by ChatGPT 5