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

Автор Qingyu, история, 5 лет назад, По-английски

Could not find an official announcement, let's discuss problems here.

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

»
5 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +14 Проголосовать: не нравится

How to solve Div.2 M(Colors and Pearls) and P(Number Sequence)?

  • »
    »
    5 лет назад, скрыть # ^ |
     
    Проголосовать: нравится +49 Проголосовать: не нравится

    It looks like the problems for Div.2 were taken from some past ICPC Asia online contests...

    M: A brute force solution is to denote $$$f_n$$$ as the answer for $$$a_{1} \cdots a_n$$$, then $$$f_n = \min_{0 \leq i \lt n} (f_i+v^2(i,n))$$$. Note that $$$f_n \leq n$$$, so we only need to keep the states that satisfy $$$v(i,n)\leq \sqrt n$$$. Time complexity is $$$\Theta(n \sqrt n)$$$.

    Code

    N: For a pile of stones, we have $$$\mathcal G_n = \operatorname{mex}_{i+j \lt n} ( \mathcal G_i, \mathcal G_{i} \stackrel{*}{+} G_j )$$$, and you can proof $$$\mathcal G_n = *_n$$$ by induction. So the whole game is equivalent to the regular Nim game.

    Code

    O is just a simple breadth first search problem.

    P: We can make each $$$a_i\oplus b_i$$$ become $$$(111\cdots 1)_2$$$ by greedily pairing. This is obviously the optimal answer.

    Code
»
5 лет назад, скрыть # |
 
Проголосовать: нравится +19 Проголосовать: не нравится

Thanks to the problemsetters, the problems were really nice (D in particular). How to solve C, G, J and K?

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +36 Проголосовать: не нравится

Thanks to problem F! I learned something new.

Here is a tricky case not in the judge tests (it's OK as I know it's not easy to create a strong cases):

1
10 9 100 3 -63 4

We have $$$E = \{ (3,1), (6,2), (9,3), (12,4), (15,5) \}$$$ and the answer should be 701423582.

My first attempt used quadtree-like DFS but I only checked the center of the ellipse and the boundary lattice points of the square to decide that they have any intersection. It is not correct for thin ellipses.

»
5 лет назад, скрыть # |
 
Проголосовать: нравится +30 Проголосовать: не нравится

The contest is available in GYM now :)