#P8689. [蓝桥杯 2019 国 A] 填空问题
[蓝桥杯 2019 国 A] 填空问题
Problem Description
Task A: Triple Increasing Sequences
Problem Description
For a letter matrix, we define a “triple increasing sequence” as follows: find three letters in the matrix that lie in the same row, the same column, or on the same -degree diagonal line, and these three letters are in increasing order when read from left to right, from right to left, or from top to bottom.
For example, in the following matrix:
YQPD
BKEZ
AFYV
there are BKZ, BEZ, AFY, AFV, AKP, DEF, etc., a total of triple increasing sequences. Note that when the three letters are arranged from bottom-left to top-right, reading from left to right and reading from top to bottom give different orders.
For the following -row -column matrix, how many triple increasing sequences are there in total? (If you copy the text below into a file, be sure to check that the copied content matches the document. There is an attached file inc.txt whose content is the same as the text below.)
VLPWJVVNNZSWFGHSFRBCOIJTPYNEURPIGKQGPSXUGNELGRVZAG
SDLLOVGRTWEYZKKXNKIRWGZWXWRHKXFASATDWZAPZRNHTNNGQF
ZGUGXVQDQAEAHOQEADMWWXFBXECKAVIGPTKTTQFWSWPKRPSMGA
BDGMGYHAOPPRRHKYZCMFZEDELCALTBSWNTAODXYVHQNDASUFRL
YVYWQZUTEPFSFXLTZBMBQETXGXFUEBHGMJKBPNIHMYOELYZIKH
ZYZHSLTCGNANNXTUJGBYKUOJMGOGRDPKEUGVHNZJZHDUNRERBU
XFPTZKTPVQPJEMBHNTUBSMIYEGXNWQSBZMHMDRZZMJPZQTCWLR
ZNXOKBITTPSHEXWHZXFLWEMPZTBVNKNYSHCIQRIKQHFRAYWOPG
MHJKFYYBQSDPOVJICWWGGCOZSBGLSOXOFDAADZYEOBKDDTMQPA
VIDPIGELBYMEVQLASLQRUKMXSEWGHRSFVXOMHSJWWXHIBCGVIF
GWRFRFLHAMYWYZOIQODBIHHRIIMWJWJGYPFAHZZWJKRGOISUJC
EKQKKPNEYCBWOQHTYFHHQZRLFNDOVXTWASSQWXKBIVTKTUIASK
PEKNJFIVBKOZUEPPHIWLUBFUDWPIDRJKAZVJKPBRHCRMGNMFWW
CGZAXHXPDELTACGUWBXWNNZNDQYYCIQRJCULIEBQBLLMJEUSZP
RWHHQMBIJWTQPUFNAESPZHAQARNIDUCRYQAZMNVRVZUJOZUDGS
PFGAYBDEECHUXFUZIKAXYDFWJNSAOPJYWUIEJSCORRBVQHCHMR
JNVIPVEMQSHCCAXMWEFSYIGFPIXNIDXOTXTNBCHSHUZGKXFECL
YZBAIIOTWLREPZISBGJLQDALKZUKEQMKLDIPXJEPENEIPWFDLP
HBQKWJFLSEXVILKYPNSWUZLDCRTAYUUPEITQJEITZRQMMAQNLN
DQDJGOWMBFKAIGWEAJOISPFPLULIWVVALLIIHBGEZLGRHRCKGF
LXYPCVPNUKSWCCGXEYTEBAWRLWDWNHHNNNWQNIIBUCGUJYMRYW
CZDKISKUSBPFHVGSAVJBDMNPSDKFRXVVPLVAQUGVUJEXSZFGFQ
IYIJGISUANRAXTGQLAVFMQTICKQAHLEBGHAVOVVPEXIMLFWIYI
ZIIFSOPCMAWCBPKWZBUQPQLGSNIBFADUUJJHPAIUVVNWNWKDZB
HGTEEIISFGIUEUOWXVTPJDVACYQYFQUCXOXOSSMXLZDQESHXKP
FEBZHJAGIFGXSMRDKGONGELOALLSYDVILRWAPXXBPOOSWZNEAS
VJGMAOFLGYIFLJTEKDNIWHJAABCASFMAKIENSYIZZSLRSUIPCJ
BMQGMPDRCPGWKTPLOTAINXZAAJWCPUJHPOUYWNWHZAKCDMZDSR
RRARTVHZYYCEDXJQNQAINQVDJCZCZLCQWQQIKUYMYMOVMNCBVY
ABTCRRUXVGYLZILFLOFYVWFFBZNFWDZOADRDCLIRFKBFBHMAXX
Answer Submission
This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer; any extra content will not be graded.
Task B: Optimal Travel
Problem Description
China’s high-speed rail network extends in all directions and is convenient to take. Xiaoming often travels between cities by high-speed rail.
Now Xiaoming has another long holiday, and he plans to continue traveling by high-speed rail. This time, he plans to visit the following cities:
Shanghai, Guangzhou, Changsha, Xi’an, Hangzhou, Jinan, Chengdu, Nanjing, Kunming, Zhengzhou, Tianjin, Taiyuan, Wuhan, Chongqing, Nanchang, Changchun, Shenyang, Guiyang, Fuzhou.
Xiaoming plans to depart from Beijing, visit each of the above cities exactly once, and finally return to Beijing. In each city (except Beijing), Xiaoming must stay for at least 24 hours. And when Xiaoming decides to travel from one city to another, he will only choose cities with a direct high-speed rail connection, and will not transfer midway.
There is an attached file trip.txt that stores the train services Xiaoming can choose. Xiaoming will not choose any other services.
Xiaoming departs at 12:00 noon on day . Ask: if Xiaoming visits each of the above cities exactly once and finally returns to Beijing, what is the minimum number of minutes required? (Note the unit is minutes. Also note that except for Beijing, each city requires at least hours of stay, i.e. at least minutes.)
Answer Submission
This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer; any extra content will not be graded.
Task : Dice Manufacturing
Problem Description
Dice are a commonly used tool in games. A die is a regular cube, with the six faces showing to pips, one of each. Usually, the appearances of pips to are as shown in the figure below.

Among them, the shapes of , , and remain unchanged after rotations of , , or degrees, while the shapes of , , and remain unchanged after a rotation of degrees.
Xiaoming wants to manufacture a batch of dice, and he hopes to make them more interesting. He wants any two of the dice he makes to be different under any rotation. What is the maximum number of dice he can make?
Answer Submission
This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer; any extra content will not be graded.
Task D: Sequence Summation
Problem Description
After learning about divisors, Xiaoming became very curious about them. He found that, given a positive integer , it is always possible to find an integer that has exactly divisors. Xiaoming is very interested in the smallest number that has divisors, and he defines it as .
For example, .
Now Xiaoming wants to know the sum of the first values of . That is, what is ?
Answer Submission
This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer; any extra content will not be graded.
Task E: Square-Free Set
Problem Description
Xiaoming does not really like perfect squares. He even does not like two numbers whose sum is a perfect square. Today, he wants to choose some numbers from to to form a set, with the requirements that he does not choose any perfect square, and the sum of any two numbers in the set cannot be a perfect square either. What is the maximum number of elements Xiaoming can choose?
Answer Submission
This is a fill-in-the-blank problem. You only need to compute the result and submit it. The result is an integer. When submitting, fill in only this integer; any extra content will not be graded.
Input Format
Input one uppercase letter, indicating which task it is.
Output Format
According to the input task letter, output the answer for the corresponding task.
Hint
Answer template for reference.
#include<iostream>
using namespace std;
int main() {
string ans [] = {
"The answer of task A", // Replace the content in double quotes with the answer for task A
"The answer of task B", // Replace the content in double quotes with the answer for task B
"The answer of task C", // Replace the content in double quotes with the answer for task C
"The answer of task D", // Replace the content in double quotes with the answer for task D
"The answer of task E", // Replace the content in double quotes with the answer for task E
};
char T;
cin >> T;
cout << ans[T - 'A'] << endl;
return 0;
}
Translated by ChatGPT 5