#P8728. [蓝桥杯 2020 国 B] 填空问题

[蓝桥杯 2020 国 B] 填空问题

Problem Description

This problem consists of multiple fill-in-the-blank tasks. You are given an uppercase letter indicating which task it is, and you need to output the corresponding answer.

Task A: Beautiful 22

Problem Description

Xiao Lan really likes 22. This year is AD 20202020, so he is very happy.

He is curious: from AD 11 to AD 20202020 (inclusive), how many years have the digit 22 in their decimal representation?

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, only fill in this integer. Any extra content will not be scored.

Task B: Diffusion

Problem Description

Xiao Lan is drawing on an infinitely large special canvas.

This canvas can be seen as a grid, and each cell can be represented by a 2D integer coordinate.

Xiao Lan first clicks a few points on the canvas: (0,0),(2020,11),(11,14),(2000,2000)(0,0),(2020,11),(11,14),(2000,2000). Only these cells are black, and all other positions are white.

Every minute, the black color diffuses a bit. Specifically, if a cell is black, it spreads to its four adjacent cells (up, down, left, right), making those four cells black as well (if a cell was already black, it remains black).

After 20202020 minutes, how many cells on the canvas are black?

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, only fill in this integer. Any extra content will not be scored.

Task C: Number of Divisors of a Factorial

Problem Description

Define the factorial n!=1×2×3××nn! = 1 \times 2 \times 3 \times \cdots \times n.

How many divisors does 100!100! have?

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, only fill in this integer. Any extra content will not be scored.

Task D: Essentially Increasing Subsequences

Problem Description

Xiao Lan especially likes monotonically increasing things.

In a string, if you take some characters and keep them in their original order in the string, and the resulting sequence is strictly increasing, then it is called a strictly increasing subsequence of this string.

For example, in the string lanqiao, if you take the characters n\mathrm{n} and q\mathrm{q}, then nq\mathrm{nq} forms a strictly increasing subsequence. Similar strictly increasing subsequences include lnq, i, ano, etc.

Xiao Lan发现, some subsequences have different positions but the same character sequence. For example, taking the second character and the last character gives ao\mathrm{ao}, and taking the last two characters also gives ao. Xiao Lan thinks they are not essentially different.

For a string, Xiao Lan wants to know how many essentially different increasing subsequences there are.

For example, for the string lanqiao, there are 2121 essentially different increasing subsequences. They are l, a, n, q, i, o, ln, an, lq, aq, nq, ai, lo, ao, no, io, lnq, anq.

Now, for the following string (a total of 200200 lowercase English letters, shown in four lines): (If you copy the text below into a text file, please be sure to check that the copied content is exactly the same as in the document. In the task directory there is a file inc.txt, whose content is the same as the text below.)

tocyjkdzcieoiodfpbgcncsrjbhmugdnojjddhllnofawllbhf
iadgdcdjstemphmnjihecoapdjjrprrqnhgccevdarufmliqij
gihhfgdcmxvicfauachlifhafpdccfseflcdgjncadfclvfmad
vrnaaahahndsikzssoywakgnfjjaihtniptwoulxbaeqkqhewl

How many essentially different increasing subsequences 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, only fill in this integer. Any extra content will not be scored.

Task E: Toy Snake

Problem Description

Xiao Lan has a toy snake with a total of 1616 segments, labeled with numbers 11 to 1616. Each segment is a square. Two adjacent segments can be in a straight line or form a 9090 degree angle.

Xiao Lan also has a 4×44 \times 4 grid box for storing the toy snake. The cells of the box are labeled with letters A\mathrm{A} to P\mathrm{P}, totaling 1616 letters.

Xiao Lan can fold his toy snake and put it into the box. He found that there are many ways to place the toy snake into it.

The figure below shows two solutions:

Please help Xiao Lan calculate: how many different solutions are there in total? If in two solutions, there exists some segment of the toy snake that is placed in different cells of the box, then they are considered different solutions.

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, only fill in this integer. Any extra content will not be scored.

Input Format

Input one uppercase letter, indicating which task it is.

Output Format

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

Translated by ChatGPT 5