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

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

WHERE IS IT?

Edit : Ok because of the delay we are unable to participate :/

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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Where is it???

»
6 лет назад, # |
  Проголосовать: нравится +35 Проголосовать: не нравится

April Fools?

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

We are in Moscow but we can't find the link too...

»
6 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

There is an onsite contest with the same problems (Moscode). I guess there was some trouble in the onsite contest.

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

https://official.contest.yandex.ru/opencupXVIII/contest/7895/enter : "The virtual contest is in progress. You are not allowed to participate"

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

    Hi. How do you find this link? I couldn't find it at opencup.ru :(

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

      I used for i in `seq 7836 8000`; do wget "https://official.contest.yandex.ru/opencupXVIII/contest/$i/enter/"; done; in bash :/

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

According to snarknews, the contest will start one hour later, at 12:00 Moscow time.

»
6 лет назад, # |
  Проголосовать: нравится +49 Проголосовать: не нравится

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

Do anybody want to join today in team ext64 with me and savinov ?

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

7 minutes and still no link ?

UPD: this one

»
6 лет назад, # |
  Проголосовать: нравится +28 Проголосовать: не нравится

Where is 2nd division link?

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

how to solve B,H, E?

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

    B: For each added point, consider all the points within the square with length equals to the twice of current answer and centered at this point. Try all the possible triples. There won’t be too many points.

    H: dp[i][j]=min length of si - 1 when si=p[0..j]

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

    H: dynamic programming: dp[i][k] — what is the minimal length of sk - 1 such that there exists sk of length exactly i (it also should be a prefix of p). How to invent that state: think of brute force, understand that we should know lengths of sk, sk - 1 in order to generate sk + 1, then swap answer with one of dimensions (here I swapped the answer with |sk - 1|).

    Now recalculation is simple: if you have sk with a specific length and you know |sk - 1|, then you know minimal possible length of tk + 1, and you also know its maximal length (it's minimal value of z-function and |sk|; if you forget about the latter, you get WA 12).

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

I?

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

    It can always be achieved with at most two operations [1, n], [1, n - 1].

    So just check if it's possible to achieve in one operation. Otherwise, construct with the two intervals.

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

      Can you explain how you do it in two operations?

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

        You can deduce each element one by one.

        For example, to make the sequence 10 4 3 5 7, the two constructed sequence should be 7 2 1 2 7 and 3 2 2 3

»
6 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

D?

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

    If there are no boundaries at 0 and L, you take n functions yi(x) = ai ± x, and position of k-th dog at time t, is k-th sorted value of all yi(t).

    With boundaries answer is periodical over time with period 2L, so you should do . Also you should add mirrored about the border lines and find k-th value in the interval [0, L]

    To find k - th value you can use binary search over answer, so you need to count number of yi <  = checkValue, and that's possible to do with 2 binary searches over lines of same type.

    That's

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

      It's also possible to find k-th element of two merged arrays in O(logN) with few binary searches, instead of O(log2N).

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

      k-th value of union of two sorted arrays A and B in O(logn):

      Find the smallest i : A[i] >= B[k-i-1]. Return max(A[i-1], B[k-i-1]).

      Proof. We want to take k smallest numbers = i numbers from A and k-i numbers from B. Then the k-th value is f(i) = max(A[i-1], B[k-i-1]). f(i) decreases until B[k-i-1]  ≤  A[i] (i  →  i+1 means "change B[k-i-1] to A[i]").

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

How to solve C?

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

What is the expected solution for F ? I solved it with a general graph isomorphism algorithm.

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

    Smart bruteforce + random?

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

    Here I give a seemingly rigorous solution:

    Suppose we can somehow identify vertices with value . The idea is that number of multiples for values in the range are distinct.

    Vertices not adjacent to have value of prime number larger than . Call this set of vertices S.

    Then we can assign prime numbers greater than to S by its degree. e.g.: have same degree as the unknown vertices with value p1, p2, then we can arbitrarily give p1, p2 to v1, v2. Since somehow we cannot distinguish these 2 vertices.

    Now we identify all vertices with prime value. Hence we know prime factors each vertex has by its adjacent prime-valued vertices.

    The next step is to identify vertices with power of prime value (pe). Simply group vertices with single prime factor and sort them by degree, the larger degree the smaller exponent.

    For any other vertices, we can find exponents of its prime factors.

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

    We tried the same, but failed to beat the TL. Can you share your code, please?

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

      Here is the code. The backtrack function (and maybe other parts of the code) may still have some bugs that do not happen in this case.

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

How to solve A?

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

    Concentrate on one player at a time, suppose the cards he ends up with are a1, ..., ak, with a1 being the best. Let bi be number of cards the previous player (the player who passes cards to the current player) has which are better than ai. Now process the cards of the current player from best to worst.

    Card i either initially belonged to some starting hand out of which the previous player just drafted a better card (bi options) or it was the first card drafted from the starting hand of the current player (1 option). Exactly i - 1 of these options have already been taken away (by previously processed (better) cards of the current player), so bi + 1 - (i - 1) options remain, resulting in a total of ways to choose where the cards for the current player came from.

    The only thing left is to make sure that the current player started with at least one card, so we need to subtract the number of ways in which we never choose the second type of option, which is . The final answer is the product of the number of ways for each player. All this can be implemented in .