See T1 after found that the answer is unrelated to the size of the Q1QN, only related to the relative size of the two number. Then we'll all lose Q1. After drawing a sketch, the first is related to the number of combinations.
Because of the number of sequence scheme, because Q1QN determine, that is, the number of n-2 in the middle of the scheme. So it must be n-2, and the bottom of the first thought is qn-q1+ (n-1) k, and then found that is not on. So I wrote a loop to find the following number of discoveries to add n-2.
The formula was pushed out, the number of combinations can be calculated with O (n) time (the inverse of the 1-n), but it will still time out. Then, a different algorithm is used to preprocess the inverse of the factorial and factorial of all the numbers, each of which can be calculated by O (1). But the preprocessing didn't run out. And then I thought of a quick way to run. : The inverse of factorial equals the factorial of the inverse. So this problem is even a.
T2 wrote a bare greedy, should be able to take part of the.
T3 wrote a very ZZ algorithm for half a day, what n^2 the topological sort after the edge and DFS judged ... After writing a quick 200 line is a sample, the time is almost ...
Then T1 has four lines of freopen, I deleted the original right, huge loss. T2 play a stable, T3 anyway also no points will not stick. Well, that's it.
Exam Summary 10-10