#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
Problem Description
Xiao Lan really 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 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: . 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 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 .
How many divisors does 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 and , then 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 , 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 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 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 segments, labeled with numbers to . Each segment is a square. Two adjacent segments can be in a straight line or form a degree angle.
Xiao Lan also has a grid box for storing the toy snake. The cells of the box are labeled with letters to , totaling 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