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

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

Note the unusual start time of the round.

Hello, Codeforces!

Now that Gaokao is over, we are very glad to invite you to participate in CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!), which will start at 24.06.2023 17:05 (Московское время). You will be given 9 problems and 3 hours to solve them. The round will be rated for everyone.

All problems are written and prepared by Gary2005, Asuka, Crying, sjcsjcsjc, MonkeyKing, DerekFeng, KbltQaQ, ShmilyTY and me.

Statements and editorials will be available in Chinese (Simplified) after the contest.

We would like to give our sincere thanks to:

The main character of the problems will be Tenzing Tsondu.

We hope that everyone can enjoy the round! As this round is sponsored, everyone will have an opportunity to win some prizes!

Good luck!

UPD1: Here is the score distribution:

250 — 500 — 1000 — 1500 — 2000 — 2500 — 3000 — 3750 — 5000

UPD2: Tutorial is available.

UPD3: Congratulations to the winners.

  1. tourist
  2. maroonrk
  3. hos.lyric
  4. cnnfls_csy
  5. Um_nik
  6. DearMargaret
  7. jiangly
  8. potato167
  9. kotatsugame
  10. noimi

UPD4: Congratulations to the first solver of each problem.

A: alexwice
B: ksun48
C: PinkieRabbit
D: Um_nik
E: Qingyu
F: amenotiomoi
G: tourist
H: rain_boy
I: maroonrk (after contest)

UPD5: Chinese statements

UPD6: Chinese editorials

Some information from our title sponsor:

Hello, Codeforces!

We, the Ton Foundation team, are pleased to support CodeTON Round 5.

The Open Network (TON) is a fully decentralized layer-1 blockchain designed to onboard billions of users to Web3.

Since July 2022, we have been supporting Codeforces as a title sponsor. This round is another way for us to contribute to the development of the community.

The winners of CodeTON Round 5 will receive valuable prizes.

The first 1,023 participants will receive prizes in TON cryptocurrency:

  • 1st place: 1,024 TON
  • 2–3 places: 512 TON each
  • 4–7 places: 256 TON each
  • 8–15 places: 128 TON each
  • 512–1,023 places: 2 TON each

We wish you good luck at CodeTON Round 5 and hope you enjoy the contest!

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

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

Hope to become cm

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

Do I get TON

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

platelet orz

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

As a first time tester I really liked the problems and highly recommend to read all the problems!

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

As a tester, give me TON.

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

As a writer, give me TON.

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

As a writer, Gary2005 orz

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

Requesting to involve div2 testers.

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

As a tester, I recommend participation

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

Good luck with your Gaokao results!

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

Good luck Everyone

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

Let's gooo! My favourite type of rounds (combined) back after a long while!!

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

.

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

As a TON, give me participants!

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

I got you all my mind.

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

As a participant give me frequent contest.

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

Man I wish contest started half and hour later.

»
11 месяцев назад, # |
Rev. 2   Проголосовать: нравится -79 Проголосовать: не нравится

.

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

Only one tester below CM? bad idea

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

As the author mentioned Gaokao, Gaokao results will be published during the contest for many areas in China.

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

Why is the contest schedule so disoriented? Like we have 4 contests in a week(2 contests in a day) and then next contest is showing 3 weeks later :( ?

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

    Div. 1 (and Div. 1 + 2) contests usually appear on the schedule very early, unlike other contests. Like now, a Div. 1 + 2 has been announced 3 weeks into the future, but Div. 2, 3 and 4 contests usually appear on the contests page only 5 to 10 days before the contest. There is already an EDU round scheduled in 5 days after this contest and I am confident to say that there will be a lot more contests before that next Div. 1 + 2.

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

try naming dengue

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

Why can't Chinese statements be available during the contest :(

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

Hope to become newbie

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

My unmatched perspicacity coupled with my sheer indefatigability makes me a feared opponent in any realm of human endeavor.

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

I will eat kebab before this round so I hope it will be tasty round

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

Can i get +53 this time? Or Will I fail again!!!

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

Please tell me what does "TON" mean?

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

    The Open Network (TON) represents an inclusive and decentralized internet platform, aiming to establish extensive cross-chain interoperability within a secure and scalable framework. It's primary objective is to process a very high TPS, ultimately catering to hundreds of millions of users in the future.

    Read their whitepaper for more!!

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

Which province are you from?

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

I hope it is Mathforces! シ

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

I want to rating, o~.

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

Finally! Wait is about to over :)

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

Hope to become green

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

/\

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

A 5000 points problem! Sound scary.

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

Hello everybody! I am sure that the competition will be very interesting, I would like to wish everyone good luck and that you get a TON. I hope we will all get positive points in this competition. Thanks to the creators of this round. Good luck to you all again!

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

As the main character of the problems,I wish you could get a positive delta.

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

Interesting Score Distribution...

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

As a beginner, the score distribution seems pretty scary to me!! Looks like it would be a TON of fun.

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

I want to become Purple.Btw,score distribution is wild.

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

The first problem has 250 point. It does mean it is very very easy?

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

    It may be so, because round is rated for div. 1 and for them it should be easy)

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

I hope this game won't be unrated and everyone can get good scores!

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

5000 score problem vs rainboy.

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

Надеюсь на интересные задачи)

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

Hope to become expert!

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

TBH I got -50 or worse deltas at all of the previous 4 CodeTONs.
Now it's time to end this curse. GLHF!

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

For a moment, let me sum it up. It sums up to 1024*10 = 10240 TON approximately 1.2M Ruble/Rupee or 15k Euro or 100k Yuan every once or twice in a month! So much to support CF unconditionally. Ty Testers, setters and supporters!

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

Do I get a ton of TON?

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

3 hrs is a bit large contest duration

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

Literally tourist is like gun machine every time I solve reload page tourist solves some problem tourist really a big orz i finished reading problem at the time tourist solve touxh problem

»
11 месяцев назад, # |
Rev. 2   Проголосовать: нравится -13 Проголосовать: не нравится

the gap between B and C was BIG, and im gonna save my sanity by giving up;)

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

Huge gap between B and C

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

Aligaduo Tenzing Sang

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

Too hard:(

ps: Didn't note the start time, so I started half an hour later:) No TON for me!

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

Thanks you for the contest, problem D and E were really amazing!

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

    Can you give a hint how to aolve E?

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

      Dp[i] equal to min cost to cover points in triangle with points (0;k), (i;0), (i, k-i). Answer equal to dp[0]. I used lazy segtree to update and query dp's values. You should think a little about dp transitions.

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

there's a different kick and nervousness getting hooked to the screen praying for NO FST, rank fall and being a CM after a long grind.

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

E is an amazing problem, I didn't expect the final dp to be so simple after reading the statement :)

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

In $$$E$$$. We have a line of $$$k + 1$$$ cells. We can paint some cells. Paint one cell costs $$$A$$$. There are segments $$$[l_i, r_i]$$$. For every segment, if we have not painted it whole, we pay additionally $$$c_i$$$.

How to solve it?

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

    Consider $$$N$$$ lines. One line needs a triangle with a minimum side equal to the length of it. This means the cost of type $$$1$$$ is (length*A), and it will erase all complete overlapping lines. The cost of the individual is 'c'.

    Then the segment tree and DP are enough where $$$Dp[i]$$$ represents the minimum cost to erase all lines in the $$$[0, i]$$$.

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

Is E just re-adjustment of points based on c[i], and merging the triangles after that? I hope it's not just that..

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

no!!!

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

D was a bit hard to think about tbh.

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

    Hint?

    • »
      »
      »
      11 месяцев назад, # ^ |
      Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится
      Спойлер
  • »
    »
    11 месяцев назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    True, the statements pointed to a graph problem, but I couldn't find a proper conversion to a graph setup..

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

any hint for c.

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

How to solve G and H?

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

A and B were too easy but i really like C. It has been a while since i solved a dp problem

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

Good problems but for me D>E>F.

Maybe I'm Teasing GrandMaster Takagi-san now ^_^.

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

I liked the contest, but why was D worded so confusing :weary:

And now I fst... I love wasting 40min understanding statement that takes 10min to solve and 0 points in end.

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

How to solve F?

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

    for an edge, if there are $$$s$$$ points on the left and $$$k - s$$$ on the right.

    $$$|k - s - s| = k - \min(s , k - s)\times 2$$$,which is because of $$$|a-b| = a+b-2\times \min(a,b)$$$.

    And $$$\sum \min(s,k-s)$$$ for the edges means the distance all the point gather at one point.

    You can enumerate the point and calculate the distance of nearest $$$k - 1$$$ points.

    Don't mind my broken English (:

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

can anyone help me with problem D?
3 4
11110 1
10110 1
10010 2

does not pass the first case

4 4
11110 1
10110 1
10010 1
10010 1

passes the first case

but both the answer are same.. just converted the last t from 2 to 1.. t can be unique for each set.. then what is the problem??

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

    You reversed the two numbers in the first row. You should first output the total time, and then output the number of games.

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

    your printing order is wrong. First you have to print total time used in games and then the no. of games. you are printing in opposite order. It should be 4 3 11110 1 10110 1 10010 2

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

About problem $$$D$$$. It's "base" it nice. It was funny to notice after 10 minutes, that I'm just simulating dijkstra on paper.

Though, the format of problem is very bad. It was harder to understand, what am I asked to print, and how that $$$n^2$$$ is related to that. It would be better to just make something like $$$\sum_{i \in [1, n]} c_i \le 10^5$$$ and print in any format. Or print for everyone, how much time we can take him to set.

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

can C be solved using recursive dp??

mine was giving tle https://mirror.codeforces.com/contest/1842/submission/210936974

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

Wonder how many people could prove the solution of A...

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

    Yeah, I tried around 15 minutes, then observed that sum seemed to be the decider, since it was A, just went with it without testing the logic because I was already quite late and it seemed like something that could be the logic of A. lol.

  • »
    »
    11 месяцев назад, # ^ |
    Rev. 4   Проголосовать: нравится -9 Проголосовать: не нравится

    Ignore my dumb comment. should have checked carefully before posting. Understood that it indeed depends on the sum now.

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

      It depends on sums, and in if they are equal the game will be draw. In this example the arrays would look like this:

      Starting arrays:

      • 1 2 3
      • 2 2 2
      1. Move
      2. Move
      3. Move
      4. Move
      5. Move

      Because after every move the ability not only from weaker monster will be changed but also from stronger one.

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

    I think the "proof" is that any attack maintains the sum of strength on both sides. Since every attack the unit with smaller strength dies (that side loses that strength from their sum), and dishes out its strength in damage. So every attack both sides lose the same amount of strength.

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

    It’s actually pretty easy. After every move the total sum of each does not change. Therefore the final result can be determined solely based on total sum

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

I submitted problem B via codeforces.com and m3.codeforces.com and I got accepted in both, however the system subtract 50 points of my problem B' score

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

    because resumbitting substract 50 points too.

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

    You submitted in different languages so that's a different submission, even though the text is maybe the same.

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

feeling sad didn't get TON.

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

Problem C is somehow similar to: https://mirror.codeforces.com/problemset/problem/1788/E that I just need to modify a little bit.

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

    what was your approach to solve this problem

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

      Using dynamic programming. Let dp(i) is the maximum number of balls Tenzing could remove until i^th prefix. The transition is sinple. For the i^th ball, we can decide whether to choose it or not. Then dp(i) equals to maximum between dp(i — 1) if you don't choose the i^th ball, and max(i — j + 1 + dp(j — 1)) over all j < i, a[j] = a[i] if you choose it.

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

        how can you choose for all j < i , a[j] = a[i] ??? that will become N ^ 2 . You must have used some optimisation, in case your solution got accepted.

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

          As you're iterating over the array, for each value x, set $$$m[x]$$$ to be the maximum of $$$-j + 1 + dp[j-1]$$$ for $$$a_j = x$$$ seen so far. Because then for $$$dp[i]$$$, you can just say $$$dp[i] = \max(dp[i-1], i + m[a_i])$$$.

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

          Yeah, I didn't mention the optimization on purpose cause I just want to give a thorough dp idea. Of course, it's O(n^2) if you traverse all j, and you have to do something to find max(dp(j — 1) — j) efficiently. How people optimize it will be based on each one.

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

After this contest, Litang and tenzing's story will be much more popular than before.

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

When I read the statement about tenzing, I hope someone can give me a smoke.

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

The problem D without clarification was difficult to understand, but adding an explanation along with the problem statement would have been very helpful for many people.

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

What is orz ?

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

what is testcase 39 for D?

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

Finally CM (hopefully).

Well it seems like a long journey but probably it's even a longer path ahead. Here's what I learned in this journey.

  • Practice and consistency are your friend.
  • Not every contest would go same so stay ground yet avoid being demotivated
  • helping people out is one of the best ways to learn
  • Rome was not built in a day.
  • Path becomes easy when learning becomes joyful.

All the best everyone. wish you positive deltas in the future :)

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

tourist Orz

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

Some feedback on the problem set:

  • A: Great problem! Easy, still requires to notice something.
  • B: Standard, I did not really like it.
  • C: Nice problem (it feels like I met this exact problem in the past, but it might be a false memory). Initially I thought that some kind of data-structure would have been necessary, but it turns out to be just a few lines of implementation.
  • D: Cool problem again. I got stuck with the usual long long vs int bug.
  • E: Standard problem. I needed a sum/min segment tree and instead of implementing it I asked chatgpt to provide one (hopefully not violating any rule?). Then I lost 40 minutes because of an off-by-one in my part of the code. (which had less than 20 lines...). The issue was that I was not sure about the correctness of the segment-tree provided by chatgpt and thus I started debugging it even though it was perfect.
  • F: Loved this one. I got the correct idea after 20 minutes, then the implementation was straightforward.
  • G: The statement is not particularly interesting. I thought about this one for 40 minutes, without having any good idea. When I started thinking about it, I assumed that I would have solved it before the end of the contest... I was wrong.

Overall the problems were very nice and, even though my performance was underwhelming, I liked participating. Thanks to the authors.

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

    Thanks for your feedback!

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

    I don't know if you will agree, but I think H is the best problem in the contest. Please try it :)

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

      It is a fantastic problem indeed! Thank you for suggesting it.

      There is a bit of magic going on in problem H. After reading it I immediately thought "This must be a technical thing about computing the measure of an arbitrary polytope", I was wrong.

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

Did any one solve C using dp (recursively)?

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

    // you can solve this using 2 state dp


    ll recu(ll it,vector<vector<ll>>&v,vector<ll>&a,vector<vector<ll>>&dp,ll state){ if(it<=0){ return 0; } if(dp[it][state]!=-1){ return dp[it][state]; } ll ans=0; ll i1=lower_bound(v[a[it]].begin(),v[a[it]].end(),it)-v[a[it]].begin(); if(state==0) { ans=max({ans,recu(it-1,v,a,dp,0)}); if(i1!=0) ans=max(ans,recu(v[a[it]][i1-1],v,a,dp,1)+(it-v[a[it]][i1-1]+1)); } else{ ans=max(ans,recu(it-1,v,a,dp,0)); if(i1!=0) ans=max(ans,recu(v[a[it]][i1-1],v,a,dp,1)+(it-v[a[it]][i1-1])); } return dp[it][state]=ans; } void solve(){ ll n;cin>>n; vector<ll> a(n); vector<vector<ll>>v(n+1); for(ll i=0;i<n;i++){ cin>>a[i]; if(v[a[i]].size()!=0){ if(v[a[i]][v[a[i]].size()-1]!=i-1){ v[a[i]].push_back(i); } } else{ v[a[i]].push_back(i); } } vector<vector<ll>>dp(n+1,vector<ll>(2,-1)); cout<<recu(n-1,v,a,dp,0)<<endl; } signed main(){ ll t; cin>>t; while(t--){ solve(); } return 0; }
»
11 месяцев назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

My python solution for D got accepted during contest, but during system testing it got stuck in TLE. My week is ruined now.

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

    Hey, sorry I didn't get to answering your question from before.

    It's on you to research/test how any code you didn't write will perform. Python is a lot of someone else's code, with their work, wins, but also their assumptions, mistakes, and tradeoffs... and there are multiple implementations (cpython vs. pypy) each with their own characteristics. If such research is beyond your level of motivation, then c++ might spare you some friction in cp, but a lot of the issues exist in every language -- some are just taken care of due to c++'s popularity in cp (like custom stack space for deep recursion) while others still need research anyway (fast IO copypasta)...

    I'd start at "just use pypy-64" and "substitute for input, input=sys.stdin.readline is a fine starting point but other options exist"

    Things to worry about down the line:

    • lack of sorted collection like std::map
    • upside-down codeforces meta which highlights esoterica like hash hacks on the lower/weaker divs
    • needing to outgrow recursion (or learn python-specific workarounds and tradeoffs)
    • once you do that: the lack of standard-but-technically-external python libraries that make nested-loops-on-a-multi-dimensional-array-named-dp less painful (due to layers of python indirection on top of the underlying indirection from using python itself)...

    Otherwise, congrats on recognizing what D was actually asking. Good luck with whatever choice you make, and hey, you don't need to pick only one, nor does your choice need to be permanent... otherwise I'd still be writing in ye old C and just not doing any hobby coding.

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

Could I have a hint for D and E?

I've noticed from people's code that D is something to do with shortest paths, but I don't see the connection. All I know is that if 1 and n are not in the same connected component you can play for infinity.

For E, I noticed that if two triangles overlap you can replace them with one big one but I didn't know what to do from there.

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

    Notice how a set 111...0 where only the last elenent is 0 is always a viable game. How many times can you play such game? Then try constructing a weighted graph. What are the weights of this graph?

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

    for a problem D: greedily play with every playable friend until there's noone playable

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

    I think a hint is that, if you have a path from 1 to n, any time you play a game, you have to decrease an edge on that path. Because 1 has to be included and n can't be included.

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

Since the language in problem D was a bit unclear, I request to consider those cases where time spent with animals is 0 to be not considered a game that is 1 should be in that constraints should be lifted.

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

I got the idea of F after about 25 minutes, but I tried solving it with dp on tree, ignoring that it can be calculated with bruteforce. I felt into a thinking trap that it must be difficult to implement because it is F.

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

Can someone explain question D? What do the restrictions exactly mean?

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

      Thanks. I think this was written in the notification we got during contest. Is there any way to look at a contest notification again after I close it?

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

        Yes, in the dashboard page, below the questions, all past notifications appear.

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

I did D with just straight forward greedy. The idea is that the order of the set doesn't matter. So you can just start from a set of friends of only 1, then remove the smallest edge out of the connected component and add the new friend into the CC. It should take at most N games to finish.

Got a small bug with edge of weight 0 and took a whole hour to find it. So sad.

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

Can anyone help me in problem C Code1 is accepted while Code2 is giving TLE?

Base logic for both are same the only difference in Code2 we are iterating for all occurrences but in Code1 101 occurrences from start and 101 from end.

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

    I had thought of using this solution, but it would have been a hack. this solution must be hacked.

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

In problem C, I saw some solutions using a global dp array and memset, still being accepted. I was wondering that since test cases are $$$10^3$$$ unlike conventional $$$10^4$$$, probably that is making them safe. But are the submissions not on the very edge, like $$$2 * 10 ^ 8$$$ computations in $$$1$$$ second ?

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

    Yeah Actually, I still couldn't understand the intuition behind iterating 100 times from front and back. Was it pure luck/ hit and trial or am I missing something here?

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

    memset is fast because it uses some optimizations under the hood. It is much faaster than a for loop

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

how can i further optimise this solution for problem C? 210934866

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

How is the prize money distributed?

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

How can we receive the TONs?

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

    in the past, the wallet was requested later only from those who won something (cf message from system)

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

Any proofs why bfs from every vertex works for F?

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

    consider the most optimal group of K vertices, select the centroid V in it, when traversing, when we fix the vertex V as a centroid, after adding k vertices, we will find the same group because we choose the most optimal values for the centroid V

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

Can anyone prove or disprove/hack this solution for D:

I use the heuristic of picking the cut with the minimum number of edges. If an edge between two nodes goes to 0, I merge the two nodes into one node. Repeat until the graph is just 1 node.

My solution gets AC: https://mirror.codeforces.com/contest/1842/submission/210975963, but I personally think its incorrect.

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

Does G actually need formal power series/exponential generating functions? That was the only way I was able to make it make sense; it feels like there should be an easier way...

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

Got a runtime error (STATUS_ACCESS_VIOLATION) at D test 16. Does anyone know what STATUS_ACCESS_VIOLATION means? Is it the same as accessing out of range for array? The strange part is that the data range in 16 is the same as in previous tests.

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

Just loved question D

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

Hey I have an issue with my email, can i know how can i receive the prize if I don't have my email working. Can i get the prize through codeforces directly.

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

I got TON

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

When can we expect to get prize? Like what is the timeline of distribution since system testing is already over.

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

    Someone please mention whether they have received the prize or not.

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

    It takes a bit for them to reach out, maybe 1 or 2 weeks. I received prize in a previous round, it just takes a little bit.

»
11 месяцев назад, # |
Rev. 4   Проголосовать: нравится +68 Проголосовать: не нравится

In fact, there is an $$$O(n)$$$ solution for problem E(submission). I have explained it in in the "Alternative Solution" section.

»
11 месяцев назад, # |
Rev. 2   Проголосовать: нравится -23 Проголосовать: не нравится

Sorry

»
11 месяцев назад, # |
Rev. 2   Проголосовать: нравится -10 Проголосовать: не нравится

I received this message 15 minutes ago, "Attention! Your solution 210922838 for the problem 1842C significantly coincides with solutions Amanku20/210922838, kam.blehh/210949010. Such a coincidence is a clear rules violation. Note that unintentional leakage is also a violation. For example, do not use ideone.com with the default settings (public access to your code). If you have conclusive evidence that a coincidence has occurred due to the use of a common source published before the competition, write a comment to post about the round with all the details. More information can be found at http://mirror.codeforces.com/blog/entry/8790. Such violation of the rules may be the reason for blocking your account or other penalties. In case of repeated violations, your account may be blocked. "

I have not shared any code with anyone/anywhere. During the contest, I never discussed the logic with anyone. And the contestant who has plag with my solution, I don't know him or her. It happens due to coincidence I think. And I think I should not be penalised. Also I have always used VS Code to write code. I have heard first time about ideone.com

»
11 месяцев назад, # |
Rev. 3   Проголосовать: нравится -13 Проголосовать: не нравится

My rating ...

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

hello I am beherapuspanjali1122, i got an email regarding similar submissions with galir123, I apologize for the confusion but both the accounts are mine as I was not able to login to the Gmail since I forgot my laptop at home so the I used another account to at least enter the contest and solved 1 or two question and as soon as I returned home I logged in and copied the solution to main account. I am sorry I was not aware of this policy . I have access to both accounts and other galir123 account was never used too. I am really very sorry. submission — solutions galir123/210934453, beherapuspanjali1122/210934894 and solutions galir123/210935992, beherapuspanjali1122/210936092

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

    I am galir123 the owner of both beherapuspanjali1122 and galir123 account. I am really very sorry for this confusion you can contact for further verification purpose too.I am really very sorry for this inconvenience

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

      Sir I assure you both accounts are mine, you can delete this account if you want but it happened because I wasn't able to access my main account

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

Why are the ratings of this contest rolled back without notice.

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

why was this contest not rated, even though it is written it is rated? today i saw my rating and it dropped , and there is no update by organizers. please update!

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

    I was stunned after seeing such downvotes! even though my argument was correct. even Though Happy that ratings were rolled back.

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

      you said "why was the contest not rated", though it was and ratings usually get rolled back for sometime after the contest (I am not sure about the reason). Hence your comment got downvotes as you said something which was totally false, try asking questions next time when you are confused rather than jumping to conclusions, Maybe "why are the ratings rolled back" would've fetched correct responses :). Hope this helps.

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

why ratings of this are round taken away ? will they be returned?

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

Is the contest being reevaluated?

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

How will we receive the prizes won in this contest, that is, the TON cryptocurrency?

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

The game added a lot of points and I'm very grateful for the game

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

Ahh, i missed a TON

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

I think I entered wallet correctly but I still not received TON in my wallet. When will the reward be received?

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

sus

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

.

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

Has anyone received their TON yet?

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

cs

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

Just noticed how similar problem C is to the N^2 DP solution of longest increasing subsequence!

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