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

Автор snuke, история, 18 месяцев назад, По-английски

We will hold Toyota Programming Contest 2023#3(AtCoder Beginner Contest 306).

We are looking forward to your participation!

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

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

Will it be rated ? (considering the delay in judging)

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

I solved F using fenwik tree, is there easier solution?

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

    Ordered set

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

      You are talking about F — Merge Sets right?

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

        Yes. You just need to find the contribution of each element one by one by finding count of elements smaller than it ahead. Maybe you can use some other technique too but oset came to my mind. Solution

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

          Oh, yes, it seems that the idea is roughly the same and there are many different implementations.

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

      I don't trust this thing anymore tbh, shit constant factor

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

Unrated!!

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

    Whenever I perform good (yesterday solved Till F) it gets unrated :(

    Anyways enjoyed a lot!

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

my solution is still not judged. Submission

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

    Mine was judged after contest, so i think you must wait a bit

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

Problem G: I submitted this but I am still waiting for the verdict, Get the SCC that contains node 1 then get the gcd of all cycle lengths and check if it's in the form of $$$2^x5^y$$$.

Any idea if this will pass/not?

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

    I had the exact same idea but was lazy to implement it since I wasn't sure about F's verdict, I guess it'll pass if implemented carefully

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

    I believe this is the intended solution indeed

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

Two out of the last three ABCs were unrated. What's the issue surrounding the long judge times, frequent DDOS attacks or just the servers not being able to handle huge traffic?

I wish this problem is being taken care of by maybe making an optimization like on codeforcss judges to stop judging if a test case doesn't pass. Its kind of frustrating to finish the whole contest just to realize it's unrated ;(.

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

    its frustating when it happens so frequently, what a bad feeling to complete the contest and realize its unrated

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

can we do E using segment tree?

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

Hi! I'm not sure where to discuss the problems so I just post it here.

The Japanese editorial of problem G states that

  • $$$L$$$ (the set which contains all lengths of cycles) might be an infinite set.
  • Let $$$g$$$ be the greatest common divisor of all elements in $$$L$$$, if $$$g = \text{gcd}(l_1, l_2, \cdots, l_t)$$$, then all multiples of $$$g$$$ larger or equal than $$$\text{lcm}(l_1, l_2, \cdots, l_t)$$$ will appear in $$$L$$$.

So if $$$L$$$ is an infinite set, $$$l_i$$$ might be infinitely large, so $$$\text{lcm}(l_1, l_2, \cdots, l_t)$$$ might be infinitely large. How can we make sure that $$$X = 10^{10^{100}}$$$ is large enough so that we can directly check if $$$g$$$ is a divisor of $$$X$$$? That is to say, how can we calculate the upper bound of $$$\text{lcm}(l_1, l_2, \cdots, l_t)$$$?

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

    I think you wouldn't need to use them all though, if you take one with less or equal than n, then you only need to consider additional cycle sizes such that the primes different from 2 and 5 are not factors of the gcd, so every time you consider one more cycle size you divide the gcd by at least 2, meaning you only need $$$O(\log n)$$$ in total, the product of which should be smaller than X (and also their lcm).

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

    Construct a cycle $$$C$$$ such that it starts in $$$1$$$ and contains all vertices, it's easy to see that such cycle has length of at most $$$(n-1)\cdot n$$$. As you mentioned lcm can be infinite, so let's shrink $$$L$$$ as much as possible so that the gcd stays the same. If you clear it completely and start with just $$$C$$$, you may need to get rid of up to $$$10$$$ prime factors. Notice that for any prime $$$p$$$ that is not a divisor of $$$g$$$ there exists a simple cycle with length not divisible by $$$p$$$ (you can take a non-simple cycle and split it in two, then at least one cycle that remains has length not divisible by $$$p$$$). So you can find such simple cycle, glue it to $$$C$$$ (length now is at most $$$n^2$$$) and remember the result. This way you will get up to $$$11$$$ cycles with gcd of their lengths equal to $$$g$$$, and their lcm is at most $$$(n^2)^{11} = n^{22}$$$, which is surely smaller than $$$10^{10^{100}}$$$.

    Thanks to ffao for the idea.

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

Can someone help me figure out why I'm getting a RE on Problem E? My submission: https://atcoder.jp/contests/abc306/submissions/42513820 I tried generating random testcases for N = 1e5, K = 5e4 and Q = 1e5 but didn't get any RE. I guess it failed at a well curated testcase that can't* be generated randomly.

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

Hi snuke

I wrote an English user editorial here.

Later, someone pointed out that it was wrong. I wrote $$$10^8$$$ but it got AC.

I've updated it and it's $$$10^{18}$$$ now.

It will be better if you can add a hack testcase. Just a cycle length $$$131072$$$ is ok.