#P8729. [蓝桥杯 2020 国 C] 填空问题

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

Problem Description

Task A: Beautiful 22

Problem Description

Xiao Lan especially 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 fill-in-the-result problem. You only need to compute the result and submit it. The result is an integer. When submitting, write only this integer; any extra content will not be scored.

Task B: Number of Composite Numbers

Problem Description

A number is called a composite number if it has divisors other than 11 and itself. For example, 11, 22, and 33 are not composite, while 44 and 66 are composite.

Question: from 11 to 20202020, how many composite numbers are there in total?

Answer Submission

Submit an integer.

Task C: Diffusion

Problem Description

Xiao Lan is drawing on an infinitely large special canvas.

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

At the beginning, Xiao Lan marks a few points on the canvas: (0,0)(0,0), (2020,11)(2020,11), (11,14)(11,14), (2000,2000)(2000,2000). Only these cells are black; all other positions are white.

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

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

Answer Submission

This is a fill-in-the-result problem. You only need to compute the result and submit it. The result is an integer. When submitting, write only this integer; any extra content will not be scored.

Task D: Divisors of a Factorial

Problem Description

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

Question: how many divisors does 100!100! have?

Answer Submission

This is a fill-in-the-result problem. You only need to compute the result and submit it. The result is an integer. When submitting, write only this integer; any extra content will not be scored.

Task E: Essentially Increasing Subsequences

Problem Description

Xiao Lan especially likes monotonically increasing things.

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

For example, in the string lanqiao, if you take characters n\mathrm{n} and q\mathrm{q}, then nq\mathrm{nq} forms a strictly increasing subsequence. Other such subsequences include Inq, i, ano, and so on.

Xiao Lan noticed that some subsequences may have different positions, but the character sequence is the same. For example, taking the second character and the last character can produce ao\mathrm{ao}, and taking the last two characters can also produce ao. Xiao Lan thinks they are not essentially different.

For a given string, Xiao Lan wants to know how many essentially different increasing subsequences it has.

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 consider the following string (a total of 200200 lowercase English letters, displayed in four lines). (If you copy the text below into a text file, be sure to check that the copied content is exactly the same as in the document. There is a file inc.txt in the attachment, and its 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 fill-in-the-result problem. You only need to compute the result and submit it. The result is an integer. When submitting, write only 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 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