YouKn0wWho's blog

By YouKn0wWho, 2 hours ago, In English

Thanks for participating in the contest blobheart. We hope you liked the problems. We would love to hear your feedback in the comments.

If you find anything wrong in the editorial which is more likely to happen because we have written a rather long editorial to make you understand the solutions better, then comment below.

We also tried to write the thought process of how you can come up with the solution for the easier problems. The approach I followed is similar to what the current AI agents do. They first generate some thoughts, then do some actions, then gather observations, and repeat the process until they find the solution. Hope you will like this approach.

Also, don't forget to upvote the editorial. See you in the next contest!

Also, please rate the problems after checking the editorial. Because otherwise you might have solved it in a very cumbersome way that you will end up hating the problem.


How did you find the contest?
Which problem is your most favourite?
Which problem you hate the most?

Also, huge props to redpanda for creating awesome manim video editorials for problems A to D. Check it out here: https://www.youtube.com/watch?v=elRvvUbk1J4

2039A - Shohag Loves Mod

Author: YouKn0wWho

Tutorial
Code
Rate the Problem

2039B - Shohag Loves Strings

Author: YouKn0wWho

Tutorial
Code
Rate the Problem

2039C1 - Shohag Loves XOR (Easy Version)

Author: YouKn0wWho

Tutorial
Code
Rate the Problem

2039C2 - Shohag Loves XOR (Hard Version)

Author: YouKn0wWho

Tutorial
Code
Rate the Problem

2039D - Shohag Loves GCD

Author: YouKn0wWho

Tutorial
Code (Solution 1)
Code (Solution 2)
Rate the Problem

2039E - Shohag Loves Inversions

Author: YouKn0wWho

Tutorial
Code
Code (by wyrqwq, without initial casework)
Rate the Problem

2039F1 - Shohag Loves Counting (Easy Version)

Author: YouKn0wWho

Tutorial
Code (by LipArcanjo)
Rate the Problem

2039F2 - Shohag Loves Counting (Hard Version)

Author: YouKn0wWho

Tutorial
Code (unoptimized)
Code (optimized)
Rate the Problem

2039G - Shohag Loves Pebae

Author: YouKn0wWho

Tutorial
Code
Rate the Problem

2039H1 - Cool Swap Walk (Easy Version)

Author: wuhudsm

Tutorial
Code
Rate the Problem

2039H2 - Cool Swap Walk (Hard Version)

Author: wuhudsm

Tutorial
Code
Rate the Problem
  • Vote: I like it
  • -17
  • Vote: I do not like it

»
2 hours ago, # |
  Vote: I like it 0 Vote: I do not like it

Even after solving A,B my rating went from 999 to 994 why?

  • »
    »
    2 hours ago, # ^ |
      Vote: I like it +5 Vote: I do not like it

    Many people solved C1 and higher difficulty problems, so your rank dropped to 6000+ out of ~9100+ which gets calculated as a slightly lower performance than your last rating.

    You can check more on rating calculation at https://mirror.codeforces.com/blog/entry/20762 or try out some CodeForces Rating Predictor for a better view on the rank vs rating.

    • »
      »
      »
      117 minutes ago, # ^ |
        Vote: I like it +3 Vote: I do not like it

      Oh! Okay I guess I have to grind more to reach pupil

»
2 hours ago, # |
  Vote: I like it +49 Vote: I do not like it

This round was a peace of shit

»
2 hours ago, # |
  Vote: I like it +1 Vote: I do not like it

Bitmask + XOR = Pain

»
118 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

Shohag Loves Bitmasks :')

»
113 minutes ago, # |
  Vote: I like it +17 Vote: I do not like it

Shohag loves OEIS (specially A079752)

»
113 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

bro changed all the bad downvotes to average, disgusting

»
111 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

_LonggVuz. bitmasks almost killed me, the problem D saved my rating ._.

»
89 minutes ago, # |
Rev. 3   Vote: I like it +2 Vote: I do not like it

F2: Cool problem, but why set the time limit so tight? The model solution (and most of the contestants' solutions) run in over 3s, and I couldn't get my solution to run much faster than 5s during the contest. :(

  • »
    »
    5 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I agree. It's a cool problem but the time limit is too tight

»
84 minutes ago, # |
  Vote: I like it +7 Vote: I do not like it

I liked B, C1, C2, E. Thanks for the round. H also looks interesting

»
71 minute(s) ago, # |
  Vote: I like it 0 Vote: I do not like it

Anyone else solved C2 using binary search ? 😂 😂

  • »
    »
    24 minutes ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    I did. I found the highest y <= m, such that x^y is a multiple of x.

»
67 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

What's the approximate rating of D?

»
61 minute(s) ago, # |
  Vote: I like it +13 Vote: I do not like it

The problem E does not request even ability to think. We need only slow solution that can calculate the number of possible arrays without modulo for $$$n < 14$$$ (which is easy to implement) and Wolfram Mathematica function FindSequenceFunction, which attempts to find a simple function that yields the sequence, when given successive integer arguments. Using the slow solution, we get the following sequence $$$(0, 1, 2, 5, 19, 102, 682, 5321, 47071, 464570, 5057058, 60166913, 776595027)$$$ of the answers. Now, we can use FindSequenceFunction to obtain the solution:

FindSequenceFunction[{0, 1, 2, 5, 19, 102, 682, 5321, 47071, 464570, 
  5057058, 60166913, 776595027}]

It gives the answer:

DifferenceRoot[Function[{y, n}, 
    {1 + (2 + n)*y[n] + (-3 - n)*y[1 + n] + 
          y[2 + n] == 0, y[1] == 0, y[2] == 1, y[3] == 2}]]

It is the recurrence relation, which can be simply coded: 292998575.

»
47 minutes ago, # |
Rev. 2   Vote: I like it +16 Vote: I do not like it

Some learnings as an Author: Judging by the votes and comments it seems like people mostly liked the problems individually but didn't like that most problems were mathy and didn't have enough variations. So I will try to keep that in mind and will add more variations to the contest in the future.

And I am also not happy that during the contest we found out that some people found the second difference/derivative of the sequence on OEIS. I searched on OEIS before but couldn't find it (I saw that it's not there but I didn't notice that there are some deltas matching for another sequence that were written on the OEIS page, I guess I have to be better regarding finding sequences on OEIS). Otherwise, we would have definitely modified the problem. Sorry for this issue.

Hopefully next time I will try to bring a more diverse round. Thanks for participating in the round!

»
17 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

Why Shohag loves so much number theory, although problems are really good.

»
13 minutes ago, # |
Rev. 2   Vote: I like it +1 Vote: I do not like it

Bro how does D have more solves than C2

»
8 minutes ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

Hello every one I have been trying to learn more about mobius function and it’s application but I couldn’t find any resources Can some one help me in this matter ?

»
3 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

The time limit of F2 is very bad. The solution which runs in $$$\sum_i \sigma^2(i)$$$ should have passed easily. It should not be a close call. The optimisations into $$$\sum_i \sigma(i) \times p(i)$$$ do not add any new ideas, and the constraints suggest there is a solution faster than this.

The inclusion of both C1 and C2 may make sense in terms of round balance (which frankly, is still pretty bad), but I don't see it being a good idea to test the same skill-set twice.

»
2 minutes ago, # |
  Vote: I like it 0 Vote: I do not like it

There's a cute solution to D.

Let cnt(x) be the number of divisors of x, not including 1 and x.

Then, set answer[i] to be equal to S[m - x].

That's it :)

And if the index is ever negative, then output -1.

The reasoning stems from the same thoughts as the editorial, though I am too tired to write out a formal proof.