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

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

It seems that Codeforces is flooded with spam bots now. Unrated spam bots have a long history on this site. The only difference is that now they work in an automated matter, instead of people who think like bots. So why are they able to write posts in the first place?

Enough rant, Baltic Olympiad in Informatics 2023 is held in Lyngby, Denmark. Good luck to all participants!

Day 1 mirror starts in an hour. Let's discuss the problems after the contest.

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

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

How to solve day 1 problem 2? I got 66/100 with randomization.

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

Codes for which I fullscored

How to solve day2 p2?

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

I think the easier 4 problems are very standard, but I won't say much because the participants may feel differently.

For day1 p1, maybe I'm wrong, but I don't think there is any sort of participant in the world who likes such problem...

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

When will the standings be shown?

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

Anyone have insights for day 2 problem 3?

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

    Can you provide hints for day1 P1?

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

    Imagine the sequence backward: it starts from $$$N$$$ and it "spreads out", in the form of $$$N - 1$$$ or $$$x, y$$$ such that $$$xy = N$$$. Let $$$DP(S)$$$ be the minimum cost to create a sequence that contains the set $$$S$$$. Transitions are: Decrement one element, or divide one element into two smaller ones. Complexity estimation is tough, but using unordered_map makes it pass.

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

      I should learn how to read

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

      Is that a "very standard" problem to you lol xd?

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

        I never thought of something like that (I was stuck on the $$$s_1 = s_2 = \dots = s_n$$$ subtasks...), so in my opinion, either I am too inexperienced or this isn't standard lol

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

        Hmm, I think the hardest part is to learn how to hash vector.. I don't know. "write brute and pray it don't mess up for random reason" isn't too standard, maybe

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

          Using stl map worked just fine for me

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

          Lol, you chose literally the most standard and least important part of the problem and called it the hardest part xd (I assume you are aware of standard hashing of words and words<=>vectors, though standard set hashing seems even more appropriate, i.e. hash of the set is the xor of random values associated with every element of our domain)

          I admit that this problem falls under "write a (seemingly?) exponential solution and pray that the number of reachable states is low" type, which is probably not the most exciting type of problems in the world, but IMHO it is much more than just that. At least for me, this looks like a random textbook backtracking problem with no sensible solution and the thought that this could potentially be solved polynomially seems completely ridiculous. During the process you need to consider states that are sets of integers of unbounded size. It is very uncommon that something like this will lead to a polynomial solution and what is more — the solution turns out to be almost-linear, i.e. $$$O(n^{1 + o(1)})$$$! Proving this (or any other polynomial bound) was not required to get 100pts, what might have caused people who solved it "yolo way" to underappreciate its beauty

          Also, in order to get 100 points, you need to have some clever idea anyway and come up with some solution that cleverly forgets about irrelevant sequence parts (what may include guessing these if you choose to solve it forwards). It's not like the simple bruteforce has any chance of solving the problem. And even if you have that idea, it is highly nontrivial to understand why such solutions have any chance of solving that within reasonable time

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

            Man, I got 85 point at 14 minutes after contest, and after constant optimization got 100 in 25 minutes. You should grind ds to gitgud

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

              Lol. I understand that this problem turned out to be easier than expected, but you seem to either misunderstood or just ignored my main point. Also, you have 3500 rating (camping on it though), so it's not like you can't solve hard problems fast from time to time. You're lucky that it did not require knowing how FFT works though ;)

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

            For the handwaving, I noticed that for a set with fixed product there are not many worst case, for example 2*3*5*7*11 or 2^14. And this is a number theory stuff, random shits work

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

Also why does it take so long for results to be published (in both mirror and official contest)?

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

How to solve Day 1 P3?

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

    Let $$$DP[i]$$$ be the minimum time to leave the shelter $$$i$$$, given that you intend to avoid periodical damage from there. $$$DP[i] = min(DP[j] + \lceil (x[i] - x[j]) /p \rceil (p + d))$$$ plus something.

    If we can replace the fractional part to $$$\lfloor x[i] / p \rfloor - \lfloor x[j] / p \rfloor$$$, then the problem is easy. But If $$$x[j] \% p \lt x[i] \% p$$$ you have an error term of $$$1$$$. Therefore, those cases should be done separately.

    To do this, you can maintain an RMQ with key $$$x[i] \% p$$$. If the queried part has a smaller modulo, add an error term, otherwise just do it normally. Remember to do coordinate compression over $$$x[i] \% p$$$.

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

    an alternate solution with a less clean implemenation but a more obvious dp definiton than ko osaga's :

    define Dp[i][j] = minimum time to reach the shelter i at time t, such that t % p = j

    then, there are 2 types of transitions :

    1) Dp[i][(j + x[i] — x[i-1])%p] = Dp[i][j] + damage taken in interim

    2) dp[i][j] = min(dp[i][j], dp[i][(j-1}%p] + 1) (because you can wait before leaving a shelter)

    This gives an easy n * p solution.

    To improve it, you note that the 2nd kind of transition is just a range set on dp[x] — x, and the first kind of transition is range add (ill leave you to figure out the details).

    Then, you just store the dimension of p in a segment tree with range set and range add, and do n * log p updates

    For full, use dynamic segment tree

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

where can I upsolve problems?

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

For Day2 P3 can someone give example where sorted sequence isn't good, but unsorted is? Thanks in advance.

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

Is there going to be any editorial ?

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

Is it possible to submit or reach test cases of the problems? I can't submit on kattis mirror.