2019.7.18 brush title Statistics

The first question: 1065

The original code is no :()

The reason why the original did not submit this question, because they are aware of all the character strings This question needs to monotonically increasing count, did not know how to make characters monotonically increasing, there is no solving the problem.

Today saw the sunxiyue code, only to find: This question before the input initialization is definitely the best way!

AC Code:

Red frame section that is initialized.

This question is wrong in thinking too narrow, did not expect the method of initialization.

 The second question: 1075

The original Code:

Group on the popularity of the site there is also a question, when it adopted the code:

You can see the code very long, obviously there is a better solution.

Later, the data structure of the site have a much the same question how the original title appears so many times , this is not it, because this question the data limit is n <= 60000, so a run-time error.

Code:

Can be found using this code to submit entry group will submit this question much better than with the popularity of the group code.

Today we see the code, find the item number is seeking the n Cartland, so I memorized the formula and submitted it again with this code, and she passed.

AC Code:

 

Guess you like

Origin www.cnblogs.com/wangximing/p/11210268.html