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

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

How to enter the contest?

The d1 link leads to ejudge.

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

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

Judge is not working now :(

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

Is this some kind of Div2 OpenCup?

»
7 лет назад, скрыть # |
 
Проголосовать: нравится -8 Проголосовать: не нравится

How to solve C and D?

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

Our submissions has not judged in last an hour (still running). Did someone else have the same problem?

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

How to solve B?

»
7 лет назад, скрыть # |
Rev. 2  
Проголосовать: нравится +21 Проголосовать: не нравится
  1. No C++11 in a testing system. Judges are still in 2007 or what?!
  2. Submissions sent in 04:20 are still running
  3. No one answered on our clar submitted at 04:15, and didn't even read it

Worst opencup organization ever

»
7 лет назад, скрыть # |
Rev. 3  
Проголосовать: нравится 0 Проголосовать: не нравится

How to solve A without Gauss elimination?

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

    A could be solved by interpolation. But under this constraints it is not better than gauss

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

    In A we can use the fact that for every $$$k\geq d+1$$$ the following holds:

    $$$\sum_{i=0}^k(-1)^i\binom{k}{i}P(a+bi)=0.$$$

    Then we choose random $$$a$$$ and $$$b$$$ and increase $$$k$$$ until we get equality modulo $$$mod$$$.

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

    Fact: If $$$f(x)$$$ is a polynomial with degree $$$n$$$ then $$$f_{1}(x) = f(x + a) - f(x)$$$ (with any constant $$$a$$$) is a polynomial with degree $$$n-1$$$. If we define $$$f_{k}(x) = f_{k-1}(x + a) - f_{k-1}(x)$$$ then $$$f_{n}(x)$$$ will be a non-zero constant and $$$f_{n+1}(x) = 0$$$. The converse is also true. Therefore you can ask integers of form $$$b+at$$$ with some random constants $$$a$$$, $$$b$$$ and compute values of $$$f_{k}(x)$$$ accordingly. As soon as we find out $$$f_{k}(b) = f_{k}(b+a) = 0$$$ we can determine with high probability that $$$f(x)$$$ is of degree $$$k+1$$$.

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

How to solve D? We solved it O(N * sqrt(N) * log(N)), but we do not know the verdict yet.

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 3  
    Проголосовать: нравится +27 Проголосовать: не нравится

    Our solution is $$$O(N^{3/2})$$$.

    Just do sqrt decomposition. It`s easy to deal using some precalculation before the queries with a pair of sqrt blocks (sort each block), with an element and a block (just sort each block and calculate values in increasing order of elements using some pointers for each block), and, finally, after the query you solve for a pair of "pieces of blocks" (using the fact that you can store all sorted prefixes and suffixes of all blocks in $$$O(N^{3/2})$$$ time and memory).

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

    I got AC with your complexity, making the block size as low as possible and getting rid of the log in precalculation. The only part with log was sorting the "pieces of blocks" but that works quite fast since it uses little memory.

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

    I solve D with Mo + Fenwick Tree + Hard Struggle

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

Where is the baobab in the Math&Mech facility?

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

So what was the jury interactor's strategy for C?(I hope it's not a secret)

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

Our C still in queue.

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

How to solve G?

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

    You are given $$$N$$$ functions of the form $$$f_i(\theta) = |r_i sin(\theta + \alpha_i)|$$$, and you want to find $$$\theta$$$ that maximizes the sum of $$$K$$$ smallest values among $$$f_i(\theta)$$$.

    This sum is a "piecewise trigonometric function" with $$$O(N^2)$$$ pieces, so we can explicitly represent this function and compute the maximum.

    The border between two pieces is a point that satisfies $$$f_i(\theta) = 0$$$ or $$$f_i(\theta) = f_j(\theta)$$$ for some $$$i,j$$$. We should list all such angles and sort them, and do various things carefully.

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

Will be editorial or upsolving?

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

One of our submission is still pending: problem B in Java, at 0:52 during the contest. No response for clarifications. I believe the judge is broken.

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

How to solve F?

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

    Greedy. Let's store the answer for each vertex $$$v$$$ — the indices of taken decorations in its subtree. The answer for some vertex $$$v$$$ is the union of answers for all its children plus $$$w_v$$$ values of $$$v$$$. Truncate that list to $$$min(t, w_v)$$$ most expensive values, that'll be the answer. Use small-to-large and store the answer in a map to achieve $$$O(n \log^2 n)$$$.