Exam Summary 10-10

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.