AmShZ's blog

By AmShZ, 3 months ago, In English

Hello everyone!

The next Starter round is here.

Repovive Starter Round 4 will be held this Sunday.

Starter rounds are designed to be beginner-friendly, with a level close to Codeforces Div.3 / AtCoder ABC.

The contest is rated for participants with rating below $$$1700$$$, whose role is at most Sushi Roll. It is unrated for Steaks.

See you on the leaderboard!

UPD1: Congratulations to the top participants:

The Codeforces handles of the top 10 participants:

Those of you who tested the contest in advance: AKprinceofpersia, Thrb_73, nimoxide, Siyah, AmiraliRafiei and _Robi.

  • Vote: I like it
  • +63
  • Vote: I do not like it

»
3 months ago, hide # |
 
Vote: I like it +2 Vote: I do not like it

The previous Starter round was really nice. Looking forward to this one too!

»
3 months ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

Hi guys!

If you want to test this contest, please send your Codeforces handle and your Repovive registration email to my Telegram account: @H_3014.

For testing, you can either time yourself or solve the problems at your own pace.

All feedback must be sent in Telegram at least 3 hours before the contest starts.

We will update this blog after the contest to include the names of our testers and the top participants.

Good luck ♡ :)

»
3 months ago, hide # |
 
Vote: I like it -11 Vote: I do not like it

First, use the correct flag

»
3 months ago, hide # |
 
Vote: I like it +3 Vote: I do not like it

Reminder: About 4 hours to the contest.

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Tbh contest seemed more like a div.4

Problem quality was really good, especially F which I really liked.

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

I loved the problem both quantitatively and qualitatively. I'm looking forward to the next round. Thank you!

»
3 months ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

For problem F, if we remove the constraint that the distance between $$$1$$$ and $$$n$$$ is even, is there a better solution that $$$O(n^2)$$$?

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    wait there was an O(n^2) solution?

    anyways tree dp sol
    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +10 Vote: I do not like it

      I am talking about the case when the distance between $$$1$$$ and $$$n$$$ is not necessarily even. In that case you have to make a move which reduces the distance between the two iron blocks by 1 anytime in the game(so if the path is of length $$$m$$$, then you can have a $$$O(m^2)$$$ solution with $$$dp[l][r]$$$ as the number of ways if one block is at $$$path[l]$$$ and the other at $$$path[r]$$$). Your sample code fails on the tree with two vertices.

      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it +10 Vote: I do not like it

        Here is an O(n) solution.

        sol
      • »
        »
        »
        »
        3 months ago, hide # ^ |
         
        Vote: I like it 0 Vote: I do not like it

        Oh, I get it now. I thought changing

        ans *= (sz[path[path.size() - i - 1]] - sz[path[i - 1]]);
        

        to

        ans *= (sz[path[path.size() - i - (path.size() % 2 == 1)]] - sz[path[i - 1]]);
        

        would work.

  • »
    »
    3 months ago, hide # ^ |
     
    Vote: I like it +13 Vote: I do not like it

    See the submission by @alexwice, he handled both cases.

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it 0 Vote: I do not like it

      Oh, I see!! Nice to meet you haha Let's be friends from now on!!

    • »
      »
      »
      3 months ago, hide # ^ |
       
      Vote: I like it +10 Vote: I do not like it

      Interesting, looks like the number of states is actually $$$O(n)$$$ even if you use the above mentioned sol.