#P8729. [蓝桥杯 2020 国 C] 填空问题
[蓝桥杯 2020 国 C] 填空问题
Problem Description
Task A: Beautiful
Problem Description
Xiao Lan especially likes . This year is AD , so he is very happy.
He is curious: from AD to AD (inclusive), how many years have the digit 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 and itself. For example, , , and are not composite, while and are composite.
Question: from to , 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: , , , . 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 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 .
Question: how many divisors does 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 and , then 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 , 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 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 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