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

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

Hello everyone, this summer at Petrozavodsk was my second ICPC contest, now it will be held as OpenCup round.

XX Open Cup Grand Prix of Kazan takes place on Sunday, September 8, 2019, at 11:00 AM Moscow time

The link to the contest. You need an Open Cup login to participate.

To ensure Codeforces traditions, I will say thanks to the testers Benq, EvenImage, whzzt, sunset, TLE, ko_osaga, rushcheyo, jiry_2, gamegame, heuristica. Also thanks to izban with help in tasks choosing.

UPD: Now the contest is loaded to the gym!

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

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

The contest will start in less than 30 minutes!~

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

Thanks, everyone, for participating! Editorial pdf: link

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

Hello! I was the tester, and I really liked problem H here. It is easily my best problem of 2019. Please solve it!

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

My D passed a stress test but failed on test 9. Do anyone have any idea for the reason?

  • »
    »
    7 лет назад, скрыть # ^ |
    Rev. 2  
    Проголосовать: нравится +28 Проголосовать: не нравится
    10 11 3
    1 2
    1 3
    1 8
    1 9
    3 4
    3 5
    4 5
    6 7
    6 8
    7 8
    9 10
    
    

    Answer is 4.

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

    On the other hand, we got AC on problem A which failed our stresstests 8) (not sure if it satisfied input constraints but we were treating input just as a chordal graph of treewidth <=3) But we managed to find the but afterwards

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

      Maybe your algorithm of recognition is not correct for arbitary chordal graph with small treewidth?

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

        That part was trivial. Just find a vertex whose neighbourhood is a clique and remove it . Moreover, naive way of recognition gives you n^2 time, but you can do it with lexbfs in linear or n log n time (I don't remember), what gives a much better complexity than what was written in editorial, since the latter dp part is linear. But anyway, that linear dp part has constant factor sth like 100000, so yeah xD. Our bug was in processing the Join nodes, but it was very hard to find a test where it fails (it was once per a few thousands in our stresstests), so I am not surprised we managed to pass system tests. We didn't think if it is possible to find a failing tests that is compliant with problem constraints, but this should be possible.

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

          Well, if with arbitary chordal graph you found it with several thousand iterations, probably Apollonian network will require much more iterations :)

          So it was hard for me to predict your bug :(

          Anyway, hope you liked this problem xd

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

            I was the one to read it and state "well, it's rather obvious — just standard connectivity dp over bounded treewidth" and delegated coding it to Marek xD. So well, let's say that coding these is kind of a masochistic pleasure, like geometry which I forced myself to enjoy xD. And we can brag afterwards that we actually coded on a competition something that nobody sane ever attempts to code xD.

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

      Sorry for necroposting, but could you please share how you wrote the generator for chordal graphs with bounded treewidth?

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

I also love the problems, especially F, H and J. One of the best rounds ;)

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

In K, isn't there $$$K^2$$$ possible candidates? Doing Inclusion-Exclusion over that many elements is too much right?

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

How can I get an Open Cup login QwQ

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

I think the first step of A can be done by removing 3-degree vertex repeatedly.

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

300iq Can you share the problem set here as pdf or something for ppl without Open cup logins please :)

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

It's funny that problems H and J were kinda similar and during competition I thought that H will be solved by augmenting paths and J will be solved by parametric search but it turned out to be exactly opposite xD

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

In problem E how to do Gaussian Elimination in $$$O\left(\frac{(n+60)^2}{64}\right)$$$ per every new vector?

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

    Store the basis in form $$$base[i]$$$ — the vector of the maximum price which has its first bit set at $$$i$$$ or None. When adding, iterate over the set bits $$$i$$$ of the new vector. As usual, if $$$base[i]$$$ is None, put it there and break. If the price of $$$base[i]$$$ is lower than the new one, swap your vector with $$$base[i]$$$ and continue as if the new vector was in the basis and you were adding $$$base[i]$$$ to it.

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

Could someone please shed some more light on problem C? I don't really get the idea from the editorial.

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

    Let's do three DPs:
    $$$f(u, S):$$$ Number of cactuses rooted at $$$u$$$, and the nodes in set $$$S$$$ are available.
    $$$g(u, S):$$$ Same as $$$f$$$, but $$$u$$$ can create at-most $$$1$$$ sub-tree. That is, number of cactuses rooted at $$$u$$$ on nodes from $$$S$$$, such that $$$u$$$ is attached to only one other node or part of only one cycle.
    $$$h(u, v, S):$$$ Number of cactuses rooted at $$$v$$$ with nodes from $$$S$$$, that loops back to $$$u$$$. (Assuming there is already a path from $$$v$$$ to $$$u$$$, this dp should create a path from $$$u$$$ to $$$v$$$, including the possibility of $$$u\to v$$$.)

    Transitions for f(u, S)
    Transitions for g(u, S)
    Transitions for h(u, v, S)
»
7 лет назад, скрыть # |
 
Проголосовать: нравится +3 Проголосовать: не нравится

Can anyone give me 8th test of the problem D, I can't find my bug :(

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

Editorial cannot open. Is it banned? 300iq