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

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

Single Round Match 804 & International Coding Challenge

Topcoder and Cognizance'21 IIT Roorkee are excited to bring you International Coding Challenge along with SRM 804. The round is scheduled to start at 07:00 UTC-4 on April 23, 2021

Please Note: The contest will be rated but won't award you points on the TCO21 Stage 4 leaderboard. The contest's number of problems will differ from a traditional SRM. The problems are intended for division 1 but the registration is open to everyone. All contestants will participate in the same division. The Coding Phase duration will be 150 mins instead of the traditional 75 mins.

Prizes
Winner: $200
Runner-Up: $100

Registration is now open for the SRM in the Arena or Applet and closes at 06:55 UTC-4. The coding phase will start at 07:05 UTC-4, so make sure that you are all ready to go. Click here to what time it starts in your area

Some Important Links:: Match Results (match results, rating changes, challenges, individual test case results), Problem Archive, Problem Writing, Algorithm Rankings, Editorials and Older Editorials(SRM 710 and before),

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

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

Gentle Reminder: Round begins in 1hour and 30 mins :)

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

Where is c++17?

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

._.

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

You should appreciate that I resisted to offend TopCoder with swear words here even though the urge to do so is still really strong

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

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

I failed to read that $$$m \leq 18$$$ on the 500-pointer, so I found a solution with a complexity of $$$3^n$$$ regardless of $$$m$$$ instead. Unfortunately it took about 4s in the worst case. The funny thing is Radewoosh misread the problem in the same way and came up with something $$$2^n \cdot n^3$$$, which was also slightly too slow.

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

    Yeah, probably our approaches combined would give $$$O(2^n \cdot n^2)$$$, as he has a good observation while I used some techniques.

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

      Let's say we have $$$a$$$ "pairs" of colors. We want to add $$$\binom{a}{i}$$$ for each $$$i$$$ and $$$i$$$-tuple of disjoint subsets of vertices with a bipartite coloring. So we want something like $$$\sum_i \binom{a}{i} f^a = (1 + f)^a$$$ in terms of subset convolution ($$$f$$$ denotes the number of bipartite coloring for each subset of vertices). It can be done in $$$O(2^n n^2)$$$; we replace the polynomial multiplication with exponentiation during the well-known subset convolution algorithm.

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

        Could you elaborate? What exactly is going on with the $$$(1 + f)^a$$$ part, and what does it mean to replace polynomial multiplication with exponentiation? (I'm assuming you're talking about the subset convolution algorithm toward the bottom of https://codeforces.me/blog/entry/72488)

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

          Sure. Sorry that I was misunderstanding your algorithm and "bipartite coloring" part was wrong. Now that I implemented (https://ideone.com/r2HnIX ), I hope it's correct.

          Let $$$\mathcal{F}$$$ be the set of functions $$$2^{\{1,\ldots,n\}} \to \mathbb{C}$$$. For $$$f, g \in \mathcal{F}$$$, we define $$$f + g$$$ by pointwise addition and $$$f g$$$ by subset convolution. For $$$f \in \mathcal{F}$$$ and $$$a \in \mathbb{C}$$$, we define $$$a f$$$ by pointwise scalar multiplication. This way we have $$$\mathcal{F}$$$ as a $$$\mathbb{C}$$$-algebra.

          We set $$$f, g, h \in \mathcal{F}$$$ as follows: For $$$S \subseteq \{1,\ldots,n\}$$$, let $$$f(S)$$$ be the number of ways to color the vertices in $$$S$$$ in red and blue so that there are no adjancent pair of a red vertex and a blue vertex, $$$g(S)$$$ be $$$1$$$ if $$$S$$$ is an independent set, and $$$h(S)$$$ be $$$1$$$. Then the answer to the problem is of the form $$$(f^a g^b h^c)(\{1,\ldots,n\})$$$.

          (In my previous post I somehow distinguished the empty set, but this wasn't needed. It might sometimes be useful if we have non-distinguishable colors etc.)

          As it is presented in your link or in the paper, the algorithm for subset convolution consists of three steps: (1) (so-called?) zeta transformation, (2) polynomial multiplication $$$2^n$$$ times, (3) Möbius transformation. To compute $$$f^a$$$, noting that (1) and (3) have linearity, we just need to replace the step (2) with exponentiation (some polynomial to the $$$a$$$-th) $$$2^n$$$ times. There is a handy algorithm to exponentiate a polynomial in $$$O(n^2)$$$, so the overall time complexity is still $$$O(2^n n^2)$$$. Actually this is correct for any $$$a \in \mathbb{C}$$$ as long as we have $$$f(\emptyset) = 1$$$, since $$$f^a$$$ has a nice power series expansion. It is also similar for any combination of $$$\mathbb{C}$$$-algebra operations, like $$$\log f$$$.

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

What has happened with the results? This SRM literally vanished.

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

    Actually, maybe this is the right course of action? Just forget about it and pretend that it has never happened.

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

How to solve the 500 points problem ?

I got the idea of using Inclusion Exclusion principle to get the number of colorings.

For every bitmask of fixing the unlucky edges, how do we find the number of configurations of the graph ?

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

hmehta is there no editorial draft this time??