LiM_256's blog

By LiM_256, history, 5 years ago, In English
  • A

It is easy to figure out that any $$$s[i]$$$ and $$$s[i - 1]$$$ which $$$i$$$ is even ($$$1$$$ index) must have same ammount of 'a' and 'b's. So just change it greedily.

Solution
  • B

We don't need to consider "$$$+1$$$", because it is a constant. Without it, we can sort the array undecreasing and just implement it one by one. This greedy algorithm can be proved with rearrangement inequality.

Solution
  • C

You can solve this problem intuitively, with checking each "uncovered" point by trying $$$8$$$ directions of $$$(x1, y1)$$$ with 0.5 length, which x1 is in x[1...6], y1 is in y[1...6].

Solution
  • D

It is easy to figure that $$$z$$$ must be divided by $$$abs(a[i] - a[i - 1])$$$. So $$$z$$$ will become maximum if we take $$$z$$$ as its greatest common divisior, and y will become minimum.

Solution
  • E

We can do two binary search and solve the problem easily, and check answer with simple math formula.

Solution
  • F

We can construct such DP method:

DP

We can maintain it using simple data structure, such as segment tree. And the problem can be solved.

Solution

Full text and comments »

  • Vote: I like it
  • +11
  • Vote: I do not like it