Блог пользователя error202

Автор error202, 12 лет назад, По-английски

For the CET-6!

A: a easy problem n*(n-1)/4*(2*t/l) for the whole circle the left time change the circle to a line and double the length then binary search or two pointer scan as you like

B: record each word's length then calculate if the this word is the last word of a line then which one if the first word of this line. then calculate if this word is the last word of ad then which one is the first word of this ad. all this can use two pointer work in o(n). but a litter bit complex.(and i am too lazy to write code)

C: account the how mant exist and needed length 2^j. then greed, obviously if we can meet the request for 2^i 2^j (i<j) then we will work for 2^i first.also if there are 2^i 2^j are empty and 2^k request (k<i<j) then we will take the 2^i

D: middle school geometry problem can somebody tell me how to put picture in blog? (it is hard to explain without picture)

E: First binary the answer is obvious then the question is how to check the answer Also it is greedy the greedy strategy put the sheep i that can be in put and ri is minimum to put more sheep in, so after put in the line the number of expand sheep should be as small as possible let i is available and ri is minimum a1 a2 a2..at is intersect with i so for each ai, ai aj is intersect if we don't put i in the line but any ap and the expand number will at least t.it can't be more optimized.

  • Проголосовать: нравится
  • -3
  • Проголосовать: не нравится