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

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

Hello! I'm happy to announce XXI Open Cup. Grand Prix of Korea.

Special thanks to xiaowuc1 for revising our English.

List of relevant previous contests:

Enjoy!

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

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

What will be level of problems ,is it recommended for Div 2 participants?

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

    The problemset is designed for teams preparing ICPC Semifinals or World Finals.

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

Will there be a Div2 OpenCup contest?

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

    I sent it to Snark, but apparantly he didn't processed it. Div2 counterpart (KAIST 10th ICPC Mock Contest) will be uploaded to Gym shortly after.

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

Is there Div 2 editorial?

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

I: Subtract version. Only master is to calculate subtree sum quickly.

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

How to solve F?

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

    Interval graph is acyclic if there are at most 2 intervals at each point. If this is true then you can divide these alive intervals into two sets of nonoverlapping intervals. Hence you can solve this using maxflow mincost, where flow has value 2 and there are edges $$$i \to i+1$$$ with capacity $$$2$$$ and cost $$$0$$$ and $$$s \to e+1$$$ with capacity $$$1$$$ and cost $$$-w$$$ for each interval. To speed things up you need to compute potentials with dynamic programming instead of Bellman-Ford/SPFA and you can do this since this graph is acyclic.

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

Thank you for your participation!

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

How to A properly? Our solution is:

For two vectors a and b the maximal number of things we can present is max flow of the complete bipartite graph with unit edges between the sides, and with edges from source to left with capacities $$$a_i$$$ and from right to sink with capacities $$$b_i$$$. Or, equivalently, min cut. If we take $$$k$$$ vertices from the left side into the mincut and $$$m - l$$$ vertices from the right side, then we need to check if the sum of maximal $$$k$$$ $$$a_i$$$-s plus sum of maximal $$$(b_j - k)$$$-s minus sum of all $$$b$$$-s can be greater than zero, or something. This is a segment tree with += on subseg and getmax on the whole tree. Did 46 teams implement the exact this? I think it's quite tricky to avoid mistakes here.

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

    I implemented that. It's not mandatory to interpret such as maxflow, but I don't know any other solution that has a different implementation.

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

      Our interpretation was something similar to the Erdos-Gallai theorem so the implementation wasn't as tricky, but we had a lot of failed submissions because of other reasons xD

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

    Quite standard problem and approach I would say. Moreover you can copy and paste this segment tree to E and L!

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

    This problem is almost the same as the bipartite graph realization problem. Our team googled and found out the Gale–Ryser theorem. It's not hard to prove that after changing the condition of $$$\sum\limits_{i=1}^n a_i = \sum\limits_{i=1}^n b_i$$$ to $$$\sum\limits_{i=1}^n a_i \leq \sum\limits_{i=1}^m b_i$$$, the theorem works for this problem. The remaining part is just using a segment tree to keep track of the inequalities.

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

Where to find problems?

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

How could one upsolve div2 contest ?

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

E was nice, but almost identical to this problem: https://codeforces.com/contest/1109/problem/F

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

    I even have a TLE attempt on this problem, what a shame. Sorry!

    Actually, the problem had an underlying graph as a tree, but we have changed it after I remembered a problem in Ptz which was exactly the same. Though, the model solution was a complicated $$$O(n \log^2 n)$$$ one, and my solution was n^2.

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

I love this set, thanks!

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

Our solution in E was in $$$O(n\log{n})$$$ time, yet no link-cut or other fancy structures were required; the main part of our solution was to find such $$$r$$$ for each $$$l$$$ that the induced subgraph on vertices $$$[l, r]$$$ is a set of isolated paths and vertices; this is done by maintaining the paths as a set of treaps (each path is an in-order traversal of some treap) and then moving two pointers, after this some segment tree.

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

    300iq provided a fix to my idea. So we can use the Queue Undo Trick for this idea, by imagining that we insert and pop vertices, as here inserting vertices is $$$O(1)$$$ updates to dsu, but we cannot use this to replace the LCT in editorial.

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

The contest is ready in Codeforces Gym. Enjoy!

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

A set of interval covers each point at most K times if and only if it can be partitioned into K disjoint set of intervals. You can prove this by greedy algorithm or using the fact that interval graphs are perfect.

What does perfect mean in the editorial?