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

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

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.

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

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

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

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

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 месяца назад, скрыть # |
 
Проголосовать: нравится -11 Проголосовать: не нравится

First, use the correct flag

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

Reminder: About 4 hours to the contest.

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

Tbh contest seemed more like a div.4

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

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

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

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

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 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

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

    anyways tree dp sol
    • »
      »
      »
      3 месяца назад, скрыть # ^ |
       
      Проголосовать: нравится +10 Проголосовать: не нравится

      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 месяца назад, скрыть # ^ |
         
        Проголосовать: нравится +10 Проголосовать: не нравится

        Here is an O(n) solution.

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

        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 месяца назад, скрыть # ^ |
     
    Проголосовать: нравится +13 Проголосовать: не нравится

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