AtCoder Regular Contest 058
The codes for C, D, and E are here
This week I have been busy writing some things that the teacher asked me to write, and finally I collapsed gloriously on Saturday. I was so tired.
It was originally the competition last week. I still couldn’t pass F in a week. I asked some people on Codeforces and I finally understood the principle. However, I still haven’t learned the Z-algorithm mentioned by yosupo. This has also been added to the To_do_list. I will definitely come back. . .
C Iroha’s Obsession
The meaning of question C is to find a number x that is greater than or equal to n, and then it cannot be used if k numbers are given.
Violence is fine, just go up one by one and judge whether you meet the conditions. It is a bit troublesome to do it yourself.
D roha and a Grid
The meaning of question D is that a grid with a length of H and a width of W is given, and one has to walk from the upper left corner to the lower right corner. Then a lower left area is given, with a length of A and a width of B, which cannot be reached. The final number of methods is asked.
The problem is to consider this blue area, enumerate the number of ways for each point on the blue line to reach the point from the upper left corner, and then consider that these points all pass vertically through the horizontal line below, calculate how many ways the points below can reach the end point, and just add them up.
There are c(x-s+y-t,x-s) ways from the starting point (x, y) to the end point (s, t). Just count the number of combinations.

E Iroha and Haiku
The meaning of question E is that given N numbers (N<=40), each number consists of 1 to 10, ask whether three adjacent sub-segments can be found in these compositions. The sum of the first segment is
This is a great question. . . .
The method is to find those that do not match. Write 1 as 1, 2 as 10, and 3 as 100. Then the last number can be written as a 01 string, and then this string contains xyz-Haiku, which is equivalent to doing an AND operation with the 01 string composed of xyz, and the result is not 0.
F Iroha Loves Strings
The meaning of question F is that N strings are given, and they are combined in order into a string of length k, which is guaranteed to be found. Then ask what is the lexicographically smallest string.
I asked yosupo and this is what he said. I roughly understand it, but not z-algorithm. . .

After reading other people’s AC codes, some of them were confusing, and then I wrote them according to the ideas. WA always loses 4 data, I don’t know why. . .
Please explain this question to someone passing by. . .
WA code:
1 | //#pragma comment(linker, "/STACK:102400000,102400000") |