P8729 [Lanqiao Cup 2020 National C] Fill-in-the-Blank Problems

Description

## Task A: Beautiful $2$ ### Problem Description Xiao Lan especially likes $2$. This year is AD $2020$, so he is very happy. He is curious: from AD $1$ to AD $2020$ (inclusive), how many years have the digit $2$ 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 $1$ and itself. For example, $1$, $2$, and $3$ are not composite, while $4$ and $6$ are composite. Question: from $1$ to $2020$, 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)$, $(2020,11)$, $(11,14)$, $(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 $2020$ 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 \times 2 \times 3 \times \cdots \times n$. Question: how many divisors does $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 $\mathrm{n}$ and $\mathrm{q}$, then $\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 $\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 $21$ 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 $200$ 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.

Explanation/Hint

Answer template (for reference). ```cpp #include 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