cry's blog

By cry, 2 years ago, In English

Hello Codeforcers!

We are pleased to invite you to participate in CodeTON Round 8 (Div. 1 + Div. 2, Rated, Prizes!). This round will start on 30.03.2024 17:35 (Московское время) and will be rated for all participants. There will be $$$8$$$ problems to be solved in $$$3$$$ hours, with one divided into two subtasks. Similar to USACO, you will help Farmer John and his cows resolve a series of first world problems. Be there or be square.

This round was cooked up by smax, sum, oursaco, cry, and buffering.

We would like to thank the following people for making the round possible:

Score Distribution:

$$$500 - 1000 - (1250 + 750) - 2250 - 2500 - 3000 - 3000 - 4500$$$

Editorial

Congratulations to our Winners and First Solves!

Top 5:

  1. maroonrk

  2. Radewoosh

  3. ecnerwala

  4. cnnfls_csy

  5. zhoukangyang

First Solves:

A. A_G
B. jiangly
C1. ksun48
C2. turmax
D. Omer223
E. tourist
F. Radewoosh
G. tourist
H. ecnerwala

And here is the information from our title sponsor:

Hello, Codeforces!

We, the TON Foundation team, are pleased to support CodeTON Round 8.

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 8 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 8 and hope you enjoy the contest!

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

| Write comment?
»
2 years ago, hide # |
 
Vote: I like it +86 Vote: I do not like it

As a tester I really enjoyed the round and I highly recommend everyone to participate in it!

»
2 years ago, hide # |
 
Vote: I like it +33 Vote: I do not like it

As a tester, this round will happen at a really funny time!

»
2 years ago, hide # |
 
Vote: I like it +33 Vote: I do not like it

As a tester I really liked the problems, I recommend you to participate!

»
2 years ago, hide # |
 
Vote: I like it -16 Vote: I do not like it

What can 1 TON buy me ?

»
2 years ago, hide # |
Rev. 3  
Vote: I like it +75 Vote: I do not like it

Doge council decided that problems are great and you should participate

my Doge council
»
2 years ago, hide # |
 
Vote: I like it +23 Vote: I do not like it

As a tester, I'm sad I couldn't participate.

»
2 years ago, hide # |
 
Vote: I like it +7 Vote: I do not like it

OMG! rainboy is tester!

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

As a tester, I can say that this round is GOATed!

»
2 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

As a monkey tester, the cows are friendly :)

»
2 years ago, hide # |
 
Vote: I like it +27 Vote: I do not like it

As a tester, smax orz

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

as a tester with photo of Stewie Griffin i say .........................................................................Brian Griffin

»
2 years ago, hide # |
 
Vote: I like it +4 Vote: I do not like it

smax orz

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

As a tester, I enjoyed helping Farmer John with his never-ending problems.

»
2 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

As a tester, I can confirm the epicness of this contest.

»
2 years ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

As a tester, I have to say, excellent round, I hope everyone enjoys it thoroughly.

Having such intelligent individuals commenting on the problems is very encouraging, yet depressing at the same time.

Have a nice contest!

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

orz myvaluska the pupil tester

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

As a non-tester, I want to say that I hope the round will be cool

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

Is the score distribution right (1250-750) or it should be (1250-1750).

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +27 Vote: I do not like it

    C is broken up into two subtasks, the easy version worth $$$1250$$$ points and the harder version worth an additional $$$750$$$ points.

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

1800 plz!

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +23 Vote: I do not like it

Heh, just realized it would be ~4.5 years since my last rated contest, and I'm now kinda willing to take part in a rated one for old time's sake.

Hope that I would not get a -ve delta T.T

UPD: I screwed myself up badly T.T Still the problems were great anyway!

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

I wish codeforces had the same high quality UI design like ton.org does.

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

Good luck to everyone!

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

First time participating in a CodeTON, what is the difficulty of the problems in USACO terms?

Thank you in advance)

»
2 years ago, hide # |
 
Vote: I like it +6 Vote: I do not like it

value of TON tripled since the last CodeTON round, it's $5/TON now

so the first place winner will receive a prize of $5,000. wow

»
2 years ago, hide # |
 
Vote: I like it +17 Vote: I do not like it

I believe that listening to the best video game official soundtrack may help your performance during this round.

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

Thank you all for this wonderful round. I am very excited!

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

I'm glad that the prize isn't NOT coin :D

»
2 years ago, hide # |
 
Vote: I like it +12 Vote: I do not like it

mike was too lazy fixing the problem ratings so he thought why not remove rainboy completely from the contest

»
2 years ago, hide # |
 
Vote: I like it +11 Vote: I do not like it

WOW! Benq Geothermal and rainboy! This test will be wonderful!

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

What does (1250+750) represents in terms of points, like do we need to solve both the problems to get the points, if not why the D problem is of 750 pints ?

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

    I believe that problem will have easy and hard version

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +4 Vote: I do not like it

    Problem C has two versions — C1 (easy) and C2 (hard).

    Solving C1 gives 1250 points, solving C2 gives 750.

    The solution to C2 (most likely) is also a correct solution to C1. Thus, effectively, C1 is worth 1250 and C2 is worth 1250 + 750 = 2000 points.

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

      Thanks for the reply, if i only solve c1, do i get the 1250 ?

      • »
        »
        »
        »
        2 years ago, hide # ^ |
         
        Vote: I like it +1 Vote: I do not like it

        Yes

        Or more specifically, similar to other problems, you won't get the full 1250 points — you'll get closer to the 1250 the sooner you solve the problem. Solving it at the very beginning of the contest would give the full 1250, but for example solving it now (at 2 hours 42 minutes into the contest), you'd only get 710 points.

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Another 1024 TON to tourist.

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

Can newbies or beginners register??? And solve problem will there degradation in rating if my problem goes wrong???

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +1 Vote: I do not like it

    anyone can participate, regardless of your rating!

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

i hope i can get 2 ton!

»
2 years ago, hide # |
 
Vote: I like it +16 Vote: I do not like it

As a tester, I almost forgot to make "as a tester" comment.

Anyway, the problems are great! Huge orz to the setters and I recommend everyone to participate in this round.

»
2 years ago, hide # |
 
Vote: I like it -45 Vote: I do not like it

left after seeing polygons...

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

INTERESTING_FORCES unfortunately got so many penalties in C2

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

Very good and interesting problemset.

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

this contes could be better

»
2 years ago, hide # |
 
Vote: I like it +9 Vote: I do not like it

Problem D: Learning to Paint is a straight-forward application of the famous interview problem.

I have added hints and thought process for this problem on CF Step.

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

254174144

Problem D. Can someone explain, why random gives TL?

Code
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    apparently multiset always TLEs and the authors wanted priority queue solution. T_T made same mistake during contest.

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

      No, the intended solution with set instead of priority_queue passes in 0.5 s.

      The question is how to make a bad test for my random solution, because it passes random tests locally in $$$\le$$$ 1 s.

»
2 years ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

is C2 constructive, casework problem?

calculate the distance, first select power of 2 to get extra, second select even until 2, then add rest? idk

»
2 years ago, hide # |
 
Vote: I like it -10 Vote: I do not like it

need hints for c1 :/

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

A question about task E: "It may be the case that the game will continue indefinitely" as far as I'm concerned, that's not true, right? I couldn't find any example configuration where the game continued indefinitely

  • »
    »
    2 years ago, hide # ^ |
    Rev. 2  
    Vote: I like it +24 Vote: I do not like it

    You're correct, that never happens.

    I guess the problemsetters didn't want to spoil anything, as the fact that every game terminates doesn't trivially follow from the way the game is described (before you think about strategy).

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

As a music gamer, I got defeated by the tiebreaker (looking forward to the solution). Anyway thanks for the cool round!

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

why did I notice E so late? T_T, idk how to solve D without segtree or efficiently with segtree

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

Can anyone tell why my code is giving wrong answer for question c2? https://mirror.codeforces.com/contest/1942/submission/254186598

UPD: Nvm, system tests are over

»
2 years ago, hide # |
 
Vote: I like it -38 Vote: I do not like it

Problem C has definitely ruined all this competition.

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +6 Vote: I do not like it

i did bad, very bad. c1 defeated me. i don't know why i did not notice that the inner polygon is also created for 2 hours.

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

In D problem1
1- if i do dp to get maximum sum(mx_sum) and hm ways i can get this sum (freq)
2- k-=freq
3- then dose 1 again but i wanna second max so i use the mx_sum from last dp.

is this solution will pass?

»
2 years ago, hide # |
 
Vote: I like it -24 Vote: I do not like it

A frustrating contest indeed !!

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

Are some of my observations for E incorrect?

  • The only thing which actually matters is the min gap between some $$$a_i$$$ and $$$b_i$$$, i.e, $$$min(b_i - a_i)$$$.

  • Any move always preserves the parity of this, meaning P1 will always win for an odd value and lose for an even value.

  • The gap between $$$b_{i - 1}$$$ and $$$a_i$$$ doesn't matter since A's movement left / B's movement right is bounded while the other's is unbounded (subject to the loss by parity above).

  • So for each odd gap upto $$$L$$$, we can count the number of ways of the min gap between an $$$a_i$$$ and $$$b_i$$$ being exactly that, the answer should be the sum of those values.

  • We can get the ways of assigning gaps so min gap between $$$a_i$$$ and $$$b_i$$$ is $$$\geq x$$$ and rest are $$$\geq 0$$$ using bars and stars, so we take (ways of $$$min\ gap \geq x$$$) — (ways of $$$min\ gap \geq x + 1$$$).

This doesn't work for the large sample, any guesses on what I might be missing? (or is it just an implementation skill issue?)

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +18 Vote: I do not like it

    I don't think that only the min gap between some $$$a_i$$$ and $$$b_i$$$ matters. If you consider the array of non-zero $$$a_i - b_i$$$, $$$\Delta$$$, then $$$\Delta = {2, 4}$$$ is a loss for the first player but $$$\Delta = {2, 3}$$$ is a win. The minimum value is the same, but the result differs.

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 3  
      Vote: I like it +29 Vote: I do not like it

      Edit: I'm a dumbass, I misread the problem and though the farmer had to move ALL of their cows left / right in a given move...

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

        Holy cow, I also misread the problem and "solved" it in the exact same way you did lol

      • »
        »
        »
        »
        2 years ago, hide # ^ |
        Rev. 2  
        Vote: I like it +8 Vote: I do not like it

        I think proving it as a win by showing the interaction is hard since there are so many states. This kind of explains the solution so I'll put it in a spoiler:

        Spoiler
  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    The only thing that matters is that the gap between some $$$a_i$$$ and $$$b_i$$$ should be odd.

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

Any reason for such tight constraints in D, isn't brute force O(n^2klogk)

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +8 Vote: I do not like it

    There exists a more efficient solution, IG. $$$O(n^2*log(k)))$$$

    • »
      »
      »
      2 years ago, hide # ^ |
      Rev. 3  
      Vote: I like it 0 Vote: I do not like it

      Yes i know that, my solution was nk logn as well but got tle in implementation, now that i think about probably my fault for using segtree, should have used set instead

      • »
        »
        »
        »
        2 years ago, hide # ^ |
        Rev. 4  
        Vote: I like it 0 Vote: I do not like it

        I take my words back still giving tle with a set, was able to pass it by making an array of reverse iterators, not a fan of the constraints

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

Not gonna give any div1+div2 round onwards. Only div2 seems to be the way.

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

Great contest. Loved the problems! 💯
Fixed my bug on problem D only to see the "contest over" message flash right before I could submit. 🤧
Well, that's also a fun experience once in a while. The mistakes stick harder! 😂
Expert, here I come! 🤓

»
2 years ago, hide # |
 
Vote: I like it +5 Vote: I do not like it

not able to solve prob D since last 3 rounds. Disappointment as always

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +10 Vote: I do not like it

Could you please pose H in a data structure training contest... (or at least have a subtask?) From $$$O(NQ)$$$ to $$$\widetilde{O}(N+Q)$$$ is apparent (if you have prepared) and boring.

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +15 Vote: I do not like it

    imo it is impossible to solve this without a dynamic dp template and there are too many details in implementing. feels like this round does not have a real extremely hard problem.

»
2 years ago, hide # |
 
Vote: I like it +2 Vote: I do not like it
Happy
Sad
»
2 years ago, hide # |
Rev. 2  
Vote: I like it -19 Vote: I do not like it

.

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

Is there any $$$O(nk)$$$ solution for D?

»
2 years ago, hide # |
 
Vote: I like it +21 Vote: I do not like it

E

I misread it as selecting the kth cow and moving it (which is also a common situation, I think), and wasted an infinite amount of time. It would have been better if you had written it like a subset.

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

Can someone please explain how my $$$O(n^2log(k)log(nA))$$$ solution passes in D?

Submission

»
2 years ago, hide # |
 
Vote: I like it +28 Vote: I do not like it

Thanks for the contest, I liked ABCEF, all are high-quality interesting problems. But I dont understand why problems like D still being accepted for Div1s in 2024, isn't it just very standard problem?

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +116 Vote: I do not like it

    I definitely think there's a place for problems like D in Div1s. Even though you can say there is a standard "merge sorted lists using a priority queue" idea, it took me some time to reduce the problem to that (and I enjoyed it).

  • »
    »
    2 years ago, hide # ^ |
     
    Vote: I like it +32 Vote: I do not like it

    💀

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

just realize number of participant too low compare to regular round, why is this the case?

»
2 years ago, hide # |
 
Vote: I like it +128 Vote: I do not like it

Thanks for the contest!

For problem E, the case of $$$n = 1$$$ previously appeared in AGC 020 A which I wrote — not a big deal of course, but it helped me to come up with the solution a little bit faster.

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

Hello folks,

Do you know that JavaScript V8 4.8.0 was released in 2015? And included in node since 2016. That's over 8 years ago. Unlike most programming languages, JavaScript has evolved significantly since then. Latest available V8 version is 12.5.0 (Mar 18, 2024).

I'm well aware that JS is not usually used for competitive programming. But using obsolete language version is a guarantee that it will stay this way.

»
2 years ago, hide # |
 
Vote: I like it +10 Vote: I do not like it

Cool round, had fun. Congrats to the setters

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

Read E for the first time and solved it in 20 mins, bruhhhhhhhhh

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

Cool round , although it was strange to have a C like this

Anyway , does anybody has 7 rating points to donate to me :(

»
2 years ago, hide # |
 
Vote: I like it +13 Vote: I do not like it

It seems that G is a little too easy for the position? I personally consider F more difficult than G.

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

Why has TON skyrocketed so dramatically?

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

Can anyone help me with Golang

https://mirror.codeforces.com/contest/1942/submission/254314439

For this problem, in test 6 with n=200000, TIME_LIMIT_EXCEEDED even if I only debug and read & print the input

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

MathForces

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

I think there are too many math-like problems.

»
2 years ago, hide # |
 
Vote: I like it +8 Vote: I do not like it

How to exchange TON into dollars?thanks!

»
2 years ago, hide # |
 
Vote: I like it +38 Vote: I do not like it

Ummm, So how can I recieve the TON? I only realised that I can put a wallet in setting after the contest :))

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

i got a message from system saying that my solution coincides with some other solution for C2 1942C2 - Bessie's Birthday Cake (Hard Version) i think this is a coincidence an exactly similar question with the same logic was asked in one of the regional math olympiad i gave in fact for this particular question i gave three wrong submission before it was finally accepted and those submissions also used the same logic you can check that. System testing has skipped my submission can someone please help MikeMirzayanov priyanshu.p. Around 60 other people have a similar solution so it can be a common solution.

»
2 years ago, hide # |
Rev. 3  
Vote: I like it -11 Vote: I do not like it

Exptecing a positive increase in rating

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

Hi may I ask if prizes have been given out? I havent received anything, thank you!

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

Just received a notification about filling the wallet address. But my TON keeper says that there are two address formats, starting with E and starting with U.

Which one should I write in my profile?

»
2 years ago, hide # |
 
Vote: I like it +37 Vote: I do not like it

I won two TON coins in CodeTON Round 8, but now I don't know how I can receive them. I have a TON account

and also I updated my wallet before April 16 UTC.

What can I do beside just waiting?

»
2 years ago, hide # |
Rev. 2  
Vote: I like it +15 Vote: I do not like it

I'm still not received the Ton Coin, have anyone received it ?

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

Hey, the TON coins has not been delivered yet. Is there any update about why that happened?

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

Worst C1 I have ever seen in my entire life. Please delete this problem. Thanks!