Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

### AquaMoon's blog

By AquaMoon, 3 months ago,

Hello, Codeforces!

Winter holiday is coming! And we are excited to invite you to our third round, Polynomial Round 2022 (Div. 1 + Div. 2, Rated, Prizes!), which will be held on Dec/17/2022 17:35 (Moscow time). You are given 8 problems and 2.5 hours to solve them.

All problems were written and prepared by Ecrade_, Little09, ChthollyNotaSeniorious, DataStructures, Cirno_9baka, mejiamejia and me.

And thanks to dorijanlendvaj, gisp_zjz, gamegame, triple__a, Chenyu_Qiu, Suiseiseki, q-w-q-w-q, leukocyte, waaitg, Kubic, LHQing, RedLycoris, lucaperju, njupt_lyy, Kilo_5723, Huah, prvocislo, foreverlasting, thanhchauns2, Rhodoks, JohnVictor, Psychotic_D, VinstaG173, dannyboy20031204, 4qqqq, CoupDeGrace, wsyear, 5ab, Lavine, absi2011, UtopianZ for testing and good advice, antontrygubO_o for his excellent round coordination and help with preparation and MikeMirzayanov for great systems Codeforces and Polygon.And you, for participating!

This is our third round! Although you may find members in our team and testers who helped are not the same as the past, our permanent love and enthusiasm for coding will not change. Conspicuously, great efforts have been put in it. We are sincerely looking forward to your participation and we hope everyone will enjoy it. Besides, this round is sponsored, which indicates that everyone has an opportunity to get the prize!

UPD1: Here is the score distribution:

500 — 1000 — 1500 — 1500 — 2000 — (1500 + 1000) — 3250 — 4000

UPD2: Sorry to everyone! We must apologize because the pretest of B is not strong, leading to FST for many people. It is our fault! We don't want to make excuses. This time, we did a bad job and let everyone down. We all blamed ourselves sadly. Although we have invited a lot of testers but most of them passed all the tests, and even some of them get 'WA', they fixed their code and passed it. So we didn't pay too much attention to it -- we thought it was 'normal'. However, we didn't suppose the pretests were so weak that lots of participants get FST. Sorry again! (>_<)

And personally, firstly, I must apologize to all of you. I let you down this time. I blamed myself sadly. And I accept all the critical opinions. However, secondly, I know that you must feel angry when you find your B got FST, and that's all our fault, but because my birthday is coming, I intended to use this contest to record the growth of me and my team members, as well as my happy memories on codeforces, so could you please don't scold me too harshly when criticizing me? (Actually I am crying when typing this words; I blamed myself sadly when I saw lots of FST). I will regard all your comments as the most valuable things which urge me to become a better person and help me grow to a more mature person, but maybe I will be very painful if I see comments or messages as 'you are a trash''trash round'. (⑉꒦ິ^꒦ິ⑉)

Sorry! We did a bad job because of our carelessness this time, but we promise we will try our best to improve our comprehensive abilities, and bring a better round next time! We will keep in mind every word of encouragement and criticism, which is the driving force for our growth. Wish you happy everyday! (•ω•)

UPD3: Tutorial is available.

Thanks for all the warmth and kindness!!! I felt deeply guilty during the past few hours, now I feel better. I really appreciate your warmth and kindness!!! (●'◡'●)

We made the contest just because we would like to share our interesting ideas with you. If you like any of the ideas, we will be very delighted!!! o(≥ω≤)o

UPD4:Congratulations to the winners

And for my personal gifts: the two random number is 91 and 1028, so congratulations to sd0061 and regain0001!!! (The rank contained the virtual participants at that time, which improves randomness, only if the time and the rank both accorded with the number , you can get the gifts!!!) o(〃'▽'〃)o

Thanks to all the warmth and kindness!!! You really light up my heart!!! We will try our best next time and prepare a better round to share our interesting ideas with you!!! ✧⁺(๑•ω•๑)⁺✧

And here is the information from our title sponsor:

Prizes

The participants who end up in the first 255 positions will receive prizes. The participant on the first place will receive $256, the next two participants will receive$128, the next four participants will receive \$64, etc. Prizes will be distributed in OP (Optimism) tokens.

Polynomial is building in decentralized finance – a more fair, accessible, efficient, and transparent financial system enabled by crypto. Polynomial automates financial derivative strategies to create products that deliver passive yield on various assets. Polynomial Earn is the first DeFi Options Vault (DOV) that executes completely on-chain by selling options directly to an AMM.

If you have a background in mathematics or software engineering and a knack for problem-solving, we want to hear from you. You will have the opportunity to work on cutting-edge technology and tackle complex problems alongside a talented and driven team.

Contact form →

By joining us at this early stage, you will make fundamental decisions that will shape the course of Polynomial. We prefer passionate, quick learners with a history of excellence.

Find out more about us on our website polynomial.fi or texting rivalq.

If you wish to be part of our remote-first team or apply for an internship, please fill in the form or email gautham@polynomial.fi. Make sure to apply before Dec 20, 2022.

We wish everyone good luck and have a positive delta!

• +351

 » 3 months ago, # |   +38 Wow! Really excited about it!
•  » » 3 months ago, # ^ |   +65 Wish you good luck and have a nice time! (๑^ω^๑)
•  » » » 3 months ago, # ^ |   +50 :(
•  » » » 3 months ago, # ^ |   +2 Thank you. (..〃•ω‹〃..)
•  » » 3 months ago, # ^ | ← Rev. 2 →   +39 And tell you a secret: I will choose two participants randomly after the contest and give them some gifts made by myself!-- AquaMoon
•  » » » 3 months ago, # ^ |   +14 Yes! Welcome to our round, maybe you will be the lucky dog who can receive lovely gifts! (✪ω✪)
•  » » » » 3 months ago, # ^ |   0 uWu
•  » » » 3 months ago, # ^ |   0 Oh! thank you very much.
•  » » 3 months ago, # ^ |   0 Agree. But, I have a question: Is this contest rated or not? It just interested me, but the task is more important to me. Let's hope for success and interesting tasks. Good luck to everyone and I wish you success!
 » 3 months ago, # | ← Rev. 2 →   +73 As a tester, I regreted testing because the round is too great. I would prefer participate :sadge:Edited: it would have been a great round without such an issue.
•  » » 3 months ago, # ^ |   +48 Wow! Thanks for your support! (●'◡'●)
•  » » 3 months ago, # ^ | ← Rev. 2 →   +7 As a tester, I think it will be the best round of year $2022$. I would also prefer to participate.UPD: sorry for such an issue.
 » 3 months ago, # |   +35 As a participant, I will participate in the [expression with all powers of the variable non-negative integers] round.
 » 3 months ago, # |   +91 Cute AquaMoon!
•  » » 3 months ago, # ^ |   +40 Cute Little09! o(〃'▽'〃)o
 » 3 months ago, # |   +51 As a writer, the problems are interesting!
•  » » 3 months ago, # ^ |   +30 Yes! Btw orz ChthollyNotaSeniorious (>▽<)
 » 3 months ago, # | ← Rev. 3 →   +184 Since the title is literally "Polynomial round", please predict number of FFT problems0 1 2 3 4 5 6 7 8
•  » » 3 months ago, # ^ |   +37 Maybe the title influences on the tasks scarcely ✧⁺(๑•ω•๑)⁺✧
 » 3 months ago, # | ← Rev. 6 →   +43 Wow! Interesting! Hope for positive delta! (give me IM)
•  » » 3 months ago, # ^ |   +8 Wish you IM (●'◡'●)
 » 3 months ago, # |   +32 Wow!!! Hoping for a great round again!!
•  » » 3 months ago, # ^ |   0 Wish you good luck and enjoy yourself! (๑^ω^๑)
 » 3 months ago, # | ← Rev. 2 →   +19 So, how to do D? It seems no less than impossible
•  » » 3 months ago, # ^ | ← Rev. 2 →   +20 Sorry, not our round (●'◡'●) please click here : https://codeforces.com/blog/entry/110056
•  » » » 3 months ago, # ^ |   +6 oh, wow, sorry
•  » » » » 3 months ago, # ^ |   +60 That's all right! And welcome to our round ✧⁺(๑•ω•๑)⁺✧
 » 3 months ago, # |   +15 can problem D be solved with random?
•  » » 3 months ago, # ^ |   +30 Sorry, not our round (●'◡'●) please click here : https://codeforces.com/blog/entry/110056
•  » » 3 months ago, # ^ |   +66 My man got time machine
•  » » 3 months ago, # ^ |   0 Technically yes. There exists a random order of operations that happens to be the correct order of operations. But random is most likely to be as successful as BOGO sort. (Which means that it will probably not work)
•  » » 3 months ago, # ^ |   0 In this case, I think most random algorithms (I can think of) works poorly when N is small. Also this problem has mutitasks in a test case, so the accuracy for small N may need to be larger than 1-10^9... But algos based on random still have chances to AC this problem
 » 3 months ago, # |   0 Excited for the round after having an unlucky round today :)
•  » » 3 months ago, # ^ |   +22 Wish you good luck and happy everyday!!! Don't be upset !!! I believe you will have a good time (๑^ω^๑)
•  » » » 3 months ago, # ^ |   0 Thx for the motivation... I also hope for ur red again :)
 » 3 months ago, # |   +7 Wow AquaMoon round so excited.
•  » » 3 months ago, # ^ |   +15 Thanks for your support! Wish you good luck! o(〃'▽'〃)o
 » 3 months ago, # |   0 Hope to be green before the year ends(⁠;⁠ŏ⁠﹏⁠ŏ⁠)
•  » » 3 months ago, # ^ |   0 I hope so :)
•  » » 3 months ago, # ^ |   -13 dream on
•  » » 3 months ago, # ^ | ← Rev. 2 →   0 did you solve B ?
•  » » » 3 months ago, # ^ | ← Rev. 2 →   -19 .
•  » » » » 3 months ago, # ^ |   0 ohh
 » 3 months ago, # |   0 Cute AquaMoon, cute round. ♡
•  » » 3 months ago, # ^ |   0 Missed it tho. :[
 » 3 months ago, # |   +92 Why mejiamejia "writes" so many rounds but I haven't seen any of his/her problem except A? I don't know if the codeforces rule works on him...
•  » » 3 months ago, # ^ |   +39 Mejiamejia is said to have proposed 3 div1F, he is currently hibernating because it is winter, please come back in april at deltix lab round 5
•  » » » 3 months ago, # ^ |   +8 Why mejiamejia need to hibernate? I think a human being is not need to hibernate.
•  » » » » 3 months ago, # ^ |   +53 He has transcended to god level
•  » » 3 months ago, # ^ |   0 There are many so called setters that just want to farm author or something ( not saying mejiamejia is one of them, because I don't know ), there are many rounds in which people appear as writers even tho they didn't set a single problem.Look at this, a D2D that has 6 chinese authors, which I think it's cap.
•  » » » 3 months ago, # ^ | ← Rev. 2 →   +6 Some Chinese author who is just a Expert, such as mejiamejia, don't really improve its competive level, but obsessed with creating boring problems and becoming a sorry co-author, which seriously affected my impression of the Chinese round. Should Codeforces do something to prevent this?
•  » » » 3 months ago, # ^ | ← Rev. 6 →   +26 Apologize for just seeing this picture. In fact, the author of that problem should only be ChthollyNotaSeniorious(idea) and SSerxhs(data). What I did is just to translate a simple statement to make the coordinator understand the idea.The final statement is also by SSerxhs. This doesn't mean that all Chinese authors are like this. I'm sorry this give you a bad impression. There are still many good Chinese authors with interesting ideas. I also hope codeforces can have fewer such people.
 » 3 months ago, # |   +16 As a writer, hope you can enjoy the contest and my problem.
•  » » 3 months ago, # ^ |   +8 orz DataStructures (>▽<)
 » 3 months ago, # |   +38 As a tester, the round is awesome!
•  » » 3 months ago, # ^ |   +3 Thanks for your support! (●'◡'●)
•  » » 3 months ago, # ^ |   +8 The moon shines, thank the moon.
 » 3 months ago, # |   -23 Is this rated?
•  » » 3 months ago, # ^ |   +8 Yes
 » 3 months ago, # | ← Rev. 2 →   +42 Codeforces: Daily Contest
•  » » 3 months ago, # ^ |   +11 Maybe it is a good opportunity to improve your comprehensive abilities in coding! ✧⁺(๑•ω•๑)⁺✧
•  » » 3 months ago, # ^ | ← Rev. 2 →   +1 Hoping all contests to be exciting.
•  » » 3 months ago, # ^ |   0 keeping mindlessly, contest after contest without any gap what's the point ?
 » 3 months ago, # |   0 Interesting sponsor title, will it have math questions? (=^・^=)
 » 3 months ago, # |   0 Please participate :'|
•  » » 3 months ago, # ^ |   0 No i dont want
 » 3 months ago, # |   0 This pet in image is so cute :33 W_W
•  » » 3 months ago, # ^ |   +11 Thanks! It's my favourite ~ o(〃'▽'〃)o
 » 3 months ago, # |   0 Hopin this is not CombinatoricsForces.
•  » » 3 months ago, # ^ |   +1 What's so bad about Combinatorics!? Its my fav!
•  » » » 3 months ago, # ^ |   0 Me noob bro. You orz.
•  » » » 3 months ago, # ^ |   0 Congratulations for CM.
•  » » » » 3 months ago, # ^ |   0 Thanks buddy :) and yeah, never think that you're noob or less capable!
 » 3 months ago, # |   0 So are there a lot of problem (4 problems or even more) of polynomial? (just a joke)
 » 3 months ago, # |   +1 Cute Girl Doing Cute Things
 » 3 months ago, # |   +196 I would very much appreciate if major rounds were announced some time in advance. Div1 is already scarce, it's sad to be unable to plan ahead.
 » 3 months ago, # |   0 After solving A,B https://i.imgflip.com/1c1uej.jpg
 » 3 months ago, # |   -29 Cock
 » 3 months ago, # |   0 It's so lucky that it is on the day before the World Cup final.
•  » » 3 months ago, # ^ |   0 a random croatian programmer somewhere is probably thinking: How dare you say that! spoilersorry about the bad pun :D`
 » 3 months ago, # |   0 Loved this contest! Finally may become Pupil!
 » 3 months ago, # | ← Rev. 3 →   +2 How to solve C ? UPD: I thought this blog is Educational Round 140 announcement LOL!
 » 3 months ago, # |   0 AquaMoon that's the cutest profile i ever saw on cf. Any chances for FFT tomorrow?
•  » » 3 months ago, # ^ |   0 what's the meaning of FFT?
•  » » » 3 months ago, # ^ |   +8 Funny Friday Today
•  » » » 3 months ago, # ^ |   0 Fast Fourier Transformation, algo to deal with huge polynomials as i know
 » 3 months ago, # | ← Rev. 2 →   +9 lol
 » 3 months ago, # |   +8 AquaMoon, how many different text emojis do you know and use? :) Out of your comments on CF, almost every one has a unique emoji~~
•  » » 3 months ago, # ^ |   +19 (〃•ω‹〃)
 » 3 months ago, # |   +8 Mildly annoyed that I seemingly always run into some sort of conflict for AquaMoon contests, soooo I'm thinking if I take a train tomorrow morning, I can compete for 1.5ish hours while sitting as a passenger rather than driving and missing out altogether... great idea or best idea?
•  » » 3 months ago, # ^ |   +5 Be happier bro, the round written by mejiamejia always turns into a sorry round. I wish you a pleasant journey!
•  » » » 3 months ago, # ^ |   +17 At least do not hide in an anonymous account, write comments with your main account !
 » 3 months ago, # |   0 Hope I do well in this div
 » 3 months ago, # |   0 Hope to solve A & B in this div
•  » » 3 months ago, # ^ |   +3 Me too.
•  » » » 3 months ago, # ^ | ← Rev. 4 →   0 Are You Comedy Me?. You have participated in just one contest in 4 years.
•  » » » » 3 months ago, # ^ |   0 I hope you are lucky in 2023.
 » 3 months ago, # | ← Rev. 2 →   0 As a participant expecting to be a good round. best of luck to all as well.
 » 3 months ago, # |   0 Good luck y'all!))
 » 3 months ago, # | ← Rev. 2 →   0 my english is poor, I hope this round will have a great description about problems
•  » » 3 months ago, # ^ | ← Rev. 3 →   +6 Sometimes even if your English is good you still cannot understand the problem bcoz they twist the problem . but wishing best for you.
 » 3 months ago, # |   -8 Hoping for Quadratic formula task!!
 » 3 months ago, # |   -8 I guess we will miss today's world cup match ):
•  » » 3 months ago, # ^ |   -8 Don't worry, tomorrow's World Cup final will be more exciting. Enjoy this round!
 » 3 months ago, # |   +2 Hope I rise up again to Specialist Excited!
 » 3 months ago, # |   0 It is time to reach 1700 scores，just today！
 » 3 months ago, # |   0 Can anyone link to past Polynomial rounds ?
 » 3 months ago, # |   +1 Hope to become Master __
•  » » 3 months ago, # ^ |   +5 all the best brother
 » 3 months ago, # |   0 are you going to post the score distribution for the problems ?
•  » » 3 months ago, # ^ |   +26 Updated. o(〃'▽'〃)o
 » 3 months ago, # |   0 1500 Points in Div 1 .. What's equal in div 2 ?
•  » » 3 months ago, # ^ |   +6 The score distribution of combined rounds are similar to Div.2 (at least in my experience)
 » 3 months ago, # |   +34 Three 1500pts, difficult strategy...
•  » » 3 months ago, # ^ | ← Rev. 2 →   +23 As an all-getter of 1500, the true difficult thing is when I start hacking. So sad.
 » 3 months ago, # |   0 I hope this is a wonderful contest,and everyone can get a good ranking.Hope everyone will have a good time!
 » 3 months ago, # |   -6 Thousands of Scurry-Coders died after the birth of ONE Astute-Coder! __________________.Which only happens in centuries._____________________
 » 3 months ago, # |   0 is the contest rated?!
 » 3 months ago, # |   0 is it rated for div 3?
•  » » 3 months ago, # ^ |   0 This round is rated for every user.
 » 3 months ago, # |   0 All ABCD are pure trash. I want to downvote every of them.
 » 3 months ago, # |   -42 trash, weak samples
 » 3 months ago, # |   +27 What's B's pretest...
•  » » 3 months ago, # ^ |   0 Seriously, I tried multiple ways by multiple logic. idk i was not able to think it in correct way.. :(
 » 3 months ago, # |   0 I am happy there are no prune forces or there is no tinkering with complexity questions in A,B,C
 » 3 months ago, # |   -6 Afraid... So many successful hacks... Will it be FSTforces?
 » 3 months ago, # |   +8 the worst pretests !! any one can hack most of his room !
•  » » 3 months ago, # ^ |   0 My solution is also wrong :(
 » 3 months ago, # |   +22 Hackforces.View room32 if you want to know more.
•  » » 3 months ago, # ^ |   0 how to view rooms?
 » 3 months ago, # |   0 Road to Newbie
 » 3 months ago, # | ← Rev. 2 →   +11 Hackforces! (even I got hacked once, lol)
 » 3 months ago, # |   0 Hints for problem b please
 » 3 months ago, # | ← Rev. 2 →   +42 The round score is determined by luck depending on how many other users there are to hack in my room.
•  » » 3 months ago, # ^ |   -9 And also if only one notice that he can hack most of his room which is unfair for all competitors
 » 3 months ago, # |   +135 The first time that I realize the importance of a nice room.
 » 3 months ago, # |   +1 Thank you for a fun round. // Got hacked.
 » 3 months ago, # |   +12 Problem B :)))
 » 3 months ago, # |   +31 thanks for saving my rating by making these pretests ))
 » 3 months ago, # |   -34 What's up with codeforces and trash pretests these days?
 » 3 months ago, # |   +12 Pretests for B are soooo weak
•  » » 3 months ago, # ^ |   0 True
•  » » 3 months ago, # ^ | ← Rev. 2 →   -10 True
 » 3 months ago, # |   0 In problem D, i am taking the first row with maximum ones and second row with minimum ones and swapping the column of that rows with different value.What's wrong with my approach?
•  » » 3 months ago, # ^ |   0 did you check if the column's value of row with maximum ones is 1 and the minimum's is 0? because if you just check if they have different value, then you might just adding more 1 to the maximum and removing from the minimum
•  » » » 3 months ago, # ^ | ← Rev. 2 →   0 very stupid mistake :(
•  » » » » 3 months ago, # ^ |   +4 it's ok, we all learn from mistakes
 » 3 months ago, # | ← Rev. 2 →   +3 Spent 1.5h on B and C...Yet immediate idea for D... if it doesn't FST, I just don't understand what was the idea of it because it was the stupidest bruteforce without thinking and my only concern was that I should impl it in cpp because seeing 1e6 operations is scary
•  » » 3 months ago, # ^ |   +1 No hacks for D apparently. It will be interesting if there will be many FSTs on D as well.
•  » » 3 months ago, # ^ |   +9 Nevermind. Here is the logic of D:There will always be a spot for which you have 1-0 if you still have a different count of ones, because you have target — 1 and target + 1 count of 1s. That is all. Therefore it doesn't matter what order you choose to do the place swaps.
 » 3 months ago, # |   0 can someone explain me what's the idea behind C
•  » » 3 months ago, # ^ |   0 learn arabic
 » 3 months ago, # |   +21 Hackforces.
•  » » 3 months ago, # ^ | ← Rev. 2 →   -11 It's very sad to see participants hacked a not hard problem through the same data and gain high marks.
 » 3 months ago, # |   0 First time solved A-E in div2Hope I can pass System TestMaybe I'll be purple if all accepted
 » 3 months ago, # | ← Rev. 2 →   +22 Holy, Hackforces and many ABCDEs passed me(ABCDEf)...If f were 2000 or higher :,-(
 » 3 months ago, # |   0 OMG!! too weak test cases while i was tryin' to solve D I realized lately that the hacking had bounced to it's peak , pretty bad test cases and the round became completely "hacks" based one ig
 » 3 months ago, # |   +156
 » 3 months ago, # |   0 What is the idea in solution B?
 » 3 months ago, # |   +4 WTF? I got hacked 1 minute before contest ends. in Problem B
•  » » 3 months ago, # ^ |   0 same
•  » » 3 months ago, # ^ |   +8 that hacker must be smart though, so you couldn't go and hacked other people that he would then hacked
 » 3 months ago, # |   +52 How to solve problem B ?
 » 3 months ago, # |   +54 It's all about comparing the number of people who write B wrongly in their room.
 » 3 months ago, # | ← Rev. 2 →   +11 For anyone wondering, try 1 17 5 4 5 5 5 1 1 for B
•  » » 3 months ago, # ^ | ← Rev. 3 →   0 .
•  » » » 3 months ago, # ^ |   0 What is the correct output for this input?
•  » » » » 3 months ago, # ^ |   +1 NO
•  » » 3 months ago, # ^ |   0 no?
 » 3 months ago, # |   +99 HackForces.The pretests for B are too weak.And it's unfair that many people get high score by hack others,but I was too late to hack others.It depend on other people in your room.
•  » » 3 months ago, # ^ |   -8 As if solving A-D wasn't painful enough already. Not a nice round. E was gorgeous, other problems I won't comment.
•  » » 3 months ago, # ^ |   0 Why shouldn't there be a problem once in a while with some weak pre-tests? It's an opportunity for us all to hunt down bugs in others' code.There is no guarantee that pre-tests are going to verify your solution to the problem. You're supposed to write a correct answer without depending on pre-tests.There are very few opportunities for hacks on Codeforces rounds when the pre-tests are extensive and, in fact, most rounds have almost no points for successful hacks.
•  » » 3 months ago, # ^ | ← Rev. 2 →   +8 Let's mourn for Mr_Eight's $\operatorname{L\color{red}{GM}}$ /(ㄒoㄒ)/~~.What happened: Mr_Eight is a handsome and powerful CPer in China. He became $\operatorname{L\color{red}{GM}}$ last month, gaining $\operatorname{L\color{red}{GM}}$ for his all 3 alts. However, A sweet fruit is short-lived. He lost his $\operatorname{L\color{red}{GM}}$, just because he attempts to solve G and doesn't notice the hack in B. He find all hackable solutions hacked before he can find out how to hack, while over $\frac{1}{3}$ of the guys ranking above him is above him because of hacking.I feel very sorry for him. Had he conquered G or even revised his B and hacked before qtpk(he hacked 14 including Mr_Eight), he'd not lost $\operatorname{L\color{red}{GM}}$, even gaining some rating instead (>_<).But he still have 2 $\operatorname{L\color{red}{GM}}$ alts. We can still orz to him(>▽<).
 » 3 months ago, # |   0 Can Somebody Explain How to solve Problem B
•  » » 3 months ago, # ^ | ← Rev. 3 →   0 you have n cells , m different colours and k given . every k consecutive cells must have different colours . and you're allowed to use the colour i exactly a_i times now how can you distribute the ith colour so no two colour of same kind are found in a k length range that is if you paint a cell with i the next possibly location for i is i+k th cell . so now check if the number of times you can use ith colour is more than n/k . that's mean you'll have to repaint a k length range of cell with another ith colour paint because because summation of a_i's for all i == n
 » 3 months ago, # |   0 And nobody solved H?
 » 3 months ago, # |   +8 Probably going to lose inf rating to subtasks and hacking :(btw, how to solve F1 without solving F2?
•  » » 3 months ago, # ^ |   0 F1 is is brute force . You can implement it with map in O(nlog^2n).
•  » » 3 months ago, # ^ |   0 Although I didn't manage to do it in time I solved it with a treap. I relied on the fact that $x \leq 2 * 10^5$ and made a rope to easily deal with a second type of operation.
•  » » 3 months ago, # ^ |   +8 hintBruteforce solution ideaAssume total damage is $x$, now it is easy to calculate total damage because it will be multiplied by $2$ after each $repeat$ and added after each $attack$.After a $repeat$ operation every pig with HP > $x$, let's call it $h$ will clone a pig with HP $h-x$.so when $repeat$, it will clone and when $attack$ , each clone attacked together.now we just need to calculate how many $repeat$ operations can make a pig alive. so there are such $O(logN)$ choices.so it is solvable in $O(NlogN)$.Sorry for the weak English.
 » 3 months ago, # | ← Rev. 9 →   +9 After a lot of suffering, I finally become CM! (but partly because of 5 hacks, but.. ugh.. it doesn't matter lol, i still performed great without them)
 » 3 months ago, # |   +44
•  » » 3 months ago, # ^ |   +6 i am waiting to be hacked!!
•  » » 3 months ago, # ^ |   0 Oh! no no no no no nooooo (●'◡'●)
 » 3 months ago, # |   0 Can someone share the approach or solution for C.
• »
»
3 months ago, # ^ |
-9

# include<bits/stdc++.h>

using namespace std;

# define int long long int

int32_t main(){ int tc; cin>>tc; while (tc--) {

int n;
cin>>n;
string s;
cin>>s;
int curr = 1;
int count = 0;
char now = '.';
for(int i = 0; i < s.size(); i++){
if(s[i] != now){
now = s[i];
count += curr;
curr = 1;
}else{
curr += 1;
}
cout<<count<<" ";
}cout<<endl;
}

return 0;

}

•  » » » 3 months ago, # ^ |   0 thanks
 » 3 months ago, # |   +47 Hackforces :(
 » 3 months ago, # | ← Rev. 2 →   +126
 » 3 months ago, # |   +14 Hackforces! Very weak pretests in problem B. Testcase I used for hacking 12/17 submissions of B in my room1 13 5 3 1 1 1 5 5
•  » » 3 months ago, # ^ |   -8 What is the answer Yes or no
•  » » » 3 months ago, # ^ |   +3 The answer is NO. All the hacked submissions missed the condition that the number of colors $i$ satisfying $a_i=\lfloor n/k\rfloor+1$ must be less than or equal to $n\bmod k$.
•  » » » » 3 months ago, # ^ |   +11 Can't believe there wasn't a single testcase in all those pretests checking for this condition !
•  » » 3 months ago, # ^ |   -8 output NO?
•  » » 3 months ago, # ^ |   -8 is the ans NO
 » 3 months ago, # |   +3 I thought we got over this. :(
 » 3 months ago, # | ← Rev. 6 →   +71 ABCD are all leaked on Youtube and Telegram. Vast majority of cheaters and leakers in this round are Indians. Why do Indian people do this? No wonder your country is a shitholeI hope Codeforces permaban all accounts that copy solutions from Youtube during live contests. If I make a small mistake and couldn't solve all of ABCD in any round, I'm going to lose like 100 points for rounds. Fuck the cheatersfor example, guess the ethnicity of the leaker in this channel? https://www.youtube.com/watch?v=aSMMDgjKXNYIMO c is quite hard and probably rated at at least 1600, 1700. No fucking way it has 5k AC.
•  » » 3 months ago, # ^ |   0 Happened in yesterday's contest too where D got leaked
•  » » 3 months ago, # ^ |   0 A recurring theme here at codeforces :(. We've seen this happening too many times...
•  » » 3 months ago, # ^ |   +2 I agree that cheating is a problem and that harsher punishment to it is required, but saying that a problem has 5k AC just because of cheating is insane. I find it incredibly farfetched to believe that even 1k people ACed C by cheating.
•  » » » 3 months ago, # ^ | ← Rev. 3 →   +2 why do you think it's farfetched? a single leaked solution has 1000 views, and that hasn't counted thousands of accounts on telegrams. I'd go as far to say 1k the least number of copied solution.And my rating is around 2000 and i struggled quite a long time with it (~30' or bit more). I remember seeing at some point the number of AC just went from ~2k ish all the way to 4,5k in a short amount of time.And to be fair, the cheating problems mostly affect beginners who are still learning how to solve ABCD of div2. They will never get to their true rating because of cheaters. It less likely to affect people who rate 2000 or higher.
 » 3 months ago, # |   -10 What? How? Why?
 » 3 months ago, # | ← Rev. 3 →   +100 Undoubtedly the worst round I've ever participated. I can't believe my eyes when so many hacks happened in B. Some people solve two problems less than me but rank higher because of the hacking. Hope you will pay more attention to the data next time.
•  » » 3 months ago, # ^ | ← Rev. 2 →   +72 I think you worry too much about ranking :) You should mostly judge the round for task quality, i.e. if it was fun to solving them.p.s. I do not say that I like/dislake this round and its tasks.
•  » » » 3 months ago, # ^ |   +11 I solve A-F2 and I don't like A-D at all. E is somehow interesting but I stuck on some wrong ideas :(. F is a pretty good problem. But anyway the whole contest makes me feel annoyed because of those issues. I can't judge a contest only by the problem quality.
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +19 I personally don't mind getting hacked on B. But as you also said, B-D are quite boring and a waste of time. I don't think greatly of F either, although I must say that E is interesting. I liked the dp+greedy idea there and it is pretty intuitive. H seems pretty good too, but I am nowhere near solving it. Overall the second half is much better, which is a bit sad since less than 10% of participants get to experience it.
•  » » » » 3 months ago, # ^ |   +67 I am so sorry about that! (T_T) Thanks for your suggestions! We still have lots of details to improve, and we will work hard to improve ourselves. We make the contests just because we have love for coding , we hope to share our ideas with others and make you happy about this ideas. But we did a bad job and let you down. (>﹏<) I am delighted to know you like E and F, I think the aim of us is sharing, even only two ideas make you happy, I think it is the most valuable thing we got. (⊙ω⊙)
•  » » 3 months ago, # ^ |   0 Hacking is part of Codeforces. We need more rounds where the pre-tests are not a crutch for all the participants and some incorrect solutions can get hacked.
 » 3 months ago, # | ← Rev. 2 →   +7 For people wondering why their submission of problem B got hacked.This is the hack test case: 14 2 32 2Correct Ans — NO
•  » » 3 months ago, # ^ |   -8 my output is no for this one
•  » » 3 months ago, # ^ |   +3 There are more, a lot of people (in my room) dodged this one with if (K > m) { cout << "NO"; } but still had incorrect solutions.
•  » » » 3 months ago, # ^ |   0 Shit!I am still in danger then :/
•  » » » » 3 months ago, # ^ |   +11 One of my hacks was this: 1 10 4 4 3 3 3 1 Basically the person was only checking how big the largest $a_i$ was. This is not enough: in this case, having one or two $a_i$-s as 3 would be fine, but having three 3-s is impossible.But in general I'm not sure if there was just one major hack. It seemed like people were just missing random cases with their logic.
•  » » » » » 3 months ago, # ^ |   +2 Fuck my solution doesnt pass this test case. LOL I hacked 10 solutions and now even my code doesnt pass this. Really weak tests cases then!
 » 3 months ago, # |   0 Can someone explain Problem F1 in Python: Basically I created a 200.000 long list where the number in the list is the amount of pigs and the index is the hp — 1.I tried: if art == 1: new_spawn[hp - 1] += 1 if art == 2: new_spawn = new_spawn[hp:] + [0] * hp hp_kill += hp if art == 3: for i in range(200000 - hp_kill): new_spawn[i] += new_spawn[hp_kill + i] hp_kill = 2 * hp_killwhich gave me a TLE and: if art == 3: new_spawn = list(map(add, new_spawn[hp_kill:] + [0] * hp_kill, new_spawn))which gave me a MLE.I am new to codeforces and hence don't even know the basics :(.Thank you very much. It was a fun round.
•  » » 3 months ago, # ^ |   +16 The issue is that it is still too slow. You could be doing $N$ operations for every query in the input. This means you might do $O(N^2)$ operations, which is too slow.In problems like this the challenge is usually not to write a program that generates the correct answers somehow, but to write a program that does it quickly. That is the hard part.
•  » » » 3 months ago, # ^ |   0 Thanks!
 » 3 months ago, # |   +127 Only 282 people solve F1, but it only has 1500 point? hacking problem has more benefit than solving problem? I don't think is a good mechanism.
 » 3 months ago, # |   +10 Pretests on problem B were garbage!
•  » » 3 months ago, # ^ |   +15 Pre-tests are not a guarantee for you. They are just a convenience. You can write your own tests anytime you like.Your solution is supposed to be complete and work whether you pass pre-tests or not.
•  » » » 3 months ago, # ^ |   0 Ok, so you made 10 more tests when your B passed pre-tests, aren't you?
 » 3 months ago, # | ← Rev. 2 →   +46 given n rooms with m people, the room is called nice if it has x >= 5 x is the number of people who's will get hacked in problem B, print Yes if the room is nice
 » 3 months ago, # |   0 Very weak pretests for b
 » 3 months ago, # |   0 what's the idea behind problem C ...?
 » 3 months ago, # |   +22 Thanks for the refreshing opportunity to hack something! Personally, I prefer pretests that do not cover everything, so that local testing is more important.
•  » » 3 months ago, # ^ |   +1 There was a post, that described why hacking is actually bad ('cause your solution can be used or published by people who solved that problem and saw your solution — they can share it to their friends or something)
•  » » 3 months ago, # ^ |   +8 Not only does it increase the importance of local testing, but it increases the importance of being the only hacker in the room, having many wrong solutions in the room (which some people call luck). Also, in the case of this contest, hacking becomes equal to solving hard problems, which is not cool. Also, some people (including me) don't look at the scoreboard often, so some people (including me) weren't aware about hacking going on. Also, some people (including me) don't look at the screen all the time, so some people (including me) are late to realize that they have been hacked.
•  » » » 3 months ago, # ^ |   0 But hey, hacking (and in my opinion the whole scoreboard) is just a tiny part of the contest.
•  » » 3 months ago, # ^ |   0 All that good man. But in this contest, hacking more problems was giving more points than solving an additional problem. It was all about are you dedicating your time to solve one more problem or to hacking.
•  » » 3 months ago, # ^ |   +15 Yes, exactly. Please don't be concerned with the ignorant down voters. Hacking mistakes is part of the Codeforces competition and the over-careful pre-tests of recent competitions have robbed us of all chances to gain with successful hacks.
 » 3 months ago, # |   +3 weakforces?
 » 3 months ago, # |   +19 Hackforces :/
 » 3 months ago, # | ← Rev. 2 →   -7 Got nutmegged by the problems.
 » 3 months ago, # |   +11 WHY ON EARTH there are Subtasks in F?
 » 3 months ago, # |   +8 How to solve E?
•  » » 3 months ago, # ^ |   0 How to solve A?
•  » » » 3 months ago, # ^ |   0
 » 3 months ago, # |   +17 Are there good tests for B in system tests? I think yes. I wonder if none of the testers got WA on those.
 » 3 months ago, # |   +43 Am I the only person who not only got hacked on B but also wasted one hour on that problem because the wording threw me off? For some reason, when I read distinct I didn't think distinct any two, I thought there had to be some that were distinct. Did my brain just shut off, or?
 » 3 months ago, # |   +51
 » 3 months ago, # |   +58 weakptforces!!!
 » 3 months ago, # |   -25 Another AquaMoon L round. Congrats!
•  » » 3 months ago, # ^ |   0 stop farming downvotes!
 » 3 months ago, # |   +2 The problems are good, but the pretests of problem B are too weak.
 » 3 months ago, # |   +117 Lol, excuses of the author are actually funny to read. Is it only me who doesn't understand why the author needs to provide any excuses for problem B? The weakness of the pretests is OK, nobody guarantees you that pretests will be strong, in the good old days of Codeforces pretests were always weak which led to interesting rounds with a lot of challenges.To everyone who still demands strong pretests for every problem — please stop it. If you don't like someone breaking your code, you have plenty of competitions without any challenges — ACM ICPC, CodeChef, etc. Don't ruin fun for everyone else and don't make authors of the rounds feel guilty when they've actually provided well organized round without bugs in reference solutions and in tests.
•  » » 3 months ago, # ^ |   0 It really only makes sense for someone to complain about pretest quality if they're orange+, so relative standings have large variation from room quality. Seeing greens complain about weak pretests is hilarious — dude, just write the correct solution.
•  » » » 3 months ago, # ^ |   0 In the Google Code Jam of 2005, Sergio Sancho of Argentina won first prize globally. He didn't solve the hardest problems; only Eryx of Poland managed to do that out of the 50 world finalists.No. Instead, Sergio was the most surgical and careful in picking out the errors in the code of other world finalists in a complicated tree computation that overlapped with some combinatorics and graphs. He found the pathological cases that made other top coders' solutions time out.It was a great victory. Even the best in the world need to learn to read others' code and pick out the problems.
•  » » 3 months ago, # ^ |   +48 Weak pretests is one thing, but I wouldn't dismiss the other (more legitimate in my opinion) criticism expressed by many commenters: hacking based on rooms.If hacking worked like Edu Rds where anyone can hack anybody afterwards, it would be quite fair. The issue is hacking gives points and is restricted to room. Look at the top of the scoreboard. It's a flurry of pts from hacking going down. So the places are being determined by something out of competitors' control, which is how many other people made a mistake in their rooms. We've effectively introduced randomness into a game about skill.As an aside, I don't think "the good old days" is itself a good reason to keep things the way they are. Formats are determined based on what the majority prefers, and the trend and design of contests in the past few years have shown that generally, people of all rating levels don't find a hack-heavy contest enjoyable.
•  » » » 3 months ago, # ^ |   +36 However, if everyone can hack everyone, the first person who finds out the weakness of the pretest can hack hundreds of people, which can gain him enormous points.
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +1 I was actually thinking of something else altogether: allow hacking of everyone but don't give pts for hacking at all, so the only incentive for hacking is to bring others down on the scoreboard which implicitly pushes you up.I guess the flaw of that idea is there would be no incentive for you to hack people below you (unless you just enjoy hacking/making others fail).
•  » » » » » 3 months ago, # ^ |   +16 Or maybe, still keep rooms, still have infinite hacks, but only give points to the first 3-5 successful hacks? After that, you can still hack, but it will not count toward point total.
•  » » » 3 months ago, # ^ |   +8 Maybe a better option that doesn't make hacking completely obsolete, but doesn't make it this broken, would be that you only get points for "new" "relevant" extra tests? As in, when you try hacking a new solution, codeforces will first of all, even before allowing you to create a new test, test it against your older hacks? If the solution is susceptible to the old hacks you have personally made before, then the solution will be hacked, but without giving you any extra points for it. And maybe allow more people to hack the same solution for points.
•  » » » 3 months ago, # ^ |   -42 If there are no bad solutions in your room, you're free to go on and solve more problems instead. Nobody is being denied opportunities.If anyone complains about lack of bad code to hack in his room, maybe he should have been one of the 12 who solved problem G which was worth more than any hack. Or even problem H which scored even more than G but nobody finished it in time.Therefore nobody has a legitimate complaint about the random distribution of rooms.
•  » » » » 3 months ago, # ^ |   +8 I think the fact that some people don't need to solve G/H because they've been handed a free 1000+ points from their lucky room is a very legitimate complaint.
 » 3 months ago, # |   +18 I started hacking B in the last 15 minutes, only to find that 80% of all submitted problem Bs had been hacked and the rest are all correct. It's all about the number of wrong submissions of B in the room and the time you start hacking. That's unfair.
 » 3 months ago, # |   0 SUN.LOVE can you please provide the test case which you used to hack my solution..others too can get the idea.
•  » » 3 months ago, # ^ |   +9 1 101 10 10 11 11 11 11 11 11 11 11 11 2
 » 3 months ago, # |   0 Hint for E? My half ideaDfs with sub dfs from each node that scans only within the d range, though it seems inefficient
•  » » 3 months ago, # ^ |   +1 First try to solve easier problem when second piece doesn't have to visit any nodes
•  » » 3 months ago, # ^ |   +1 Root the tree at 1. What will you need to do if you want one of the pieces to go to a node with depth that is greater than d?
•  » » 3 months ago, # ^ | ← Rev. 2 →   0 Think about which nodes are "must-visit"s, where both of the chess pieces have to go through (hint: if there is a node in a subtree of $u$ that one of the chess pieces has to visit, that piece must visit $u$)
 » 3 months ago, # |   +50 Maybe this comment is kind of furious, but I want to say that this is the worst codeforces round I've ever met. Not just because the absurd gap between E and F (1059 and 282), but also because of problems themselves. I don't think that such problems include too much detail to be coded should appear in one round. (I don't mean that detail isn't important, I just think that requiring too much detail in one competition isn't good) And the most important problem is obviously problem B. It is another probelm about detail. You can even easily gain 1000 or more points simply by using the same hacking data. Hacking is truly an important part of Codeforces, but Hackforces like that is, in a word, ridiculous.
•  » » 3 months ago, # ^ |   +8 Couldn't agree more.I solved A~F2,but some people solved A~E and ranked higher than me by hacking 10+.It's unbelievable.
 » 3 months ago, # | ← Rev. 2 →   -36 This is so irritating to read all these complaints about weak pretests.I will make sure to go over every comment which complains about weak pretests and give you a big fat downvote.
 » 3 months ago, # |   0 Jump on Tree may help you to solve problem E.
•  » » 3 months ago, # ^ |   +1
 » 3 months ago, # |   +20
 » 3 months ago, # |   +56 When you hack B but your own solution get hacked 🗿 🗿 💀
•  » » 3 months ago, # ^ |   +3 :-(
•  » » 3 months ago, # ^ |   0 but some people get more points
•  » » » 3 months ago, # ^ |   +14
 » 3 months ago, # | ← Rev. 3 →   0 I have wasted 2 hours thinking that how couldn't I solve B, though the accepted count was polynomial one time! If I thought about C then probably I could do that. Damn it!
 » 3 months ago, # |   +53 Hacking more problems was getting you more points than solving one extra fukin problem. LMAO ded.
 » 3 months ago, # |   +1 What's wrong with this B question! :-(
 » 3 months ago, # |   0 Hackforces
 » 3 months ago, # |   0 Nice round, as AquaMoon rounds tend to be.
 » 3 months ago, # | ← Rev. 2 →   -41 why do you even allow newbie to participate ? for Just making specialist and above people happy I guess. you can drop off A and restrict newbies from global and rounds like this. Anyway these are intended for making CM and above people happy
•  » » 3 months ago, # ^ |   0 why do you even allow newbie to participate ? for Just making specialist and above people happy I guess. you can drop off A and restrict newbies from global and rounds like this. Anyway these are intended for making CM and above people happy
 » 3 months ago, # |   0 Good problems!I enjoy being hacked :(
 » 3 months ago, # |   +5 Thank you for the contest. Pretests on B ruined the experience tho. Some people legitimately had to choose between hacking others or solving problems. Was unnecessarily stressful last few minutes.
 » 3 months ago, # |   0
 » 3 months ago, # |   0 The contest made me realise it again that passing pretests is not enough to get the solution accepted.
•  » » 3 months ago, # ^ |   -14 A good lesson that should be taught more often.
 » 3 months ago, # | ← Rev. 2 →   +11 Damn, I got "denial of judgement" on D. And the problem B is absolutely the worst. Yet another single observation problem, where everyone either see it immediately and get instant AC or suffer for eternity and need to skip the problem. But at least pretests were very weak, which is in my opinion very good for this kind of problems. Also, I believe I've seen this B somewhere before, which is frustrating, as I hated it first time as well.
•  » » 3 months ago, # ^ |   0 What is denial of judgement?
•  » » » 3 months ago, # ^ |   +1 The checker failed on my submission.
 » 3 months ago, # | ← Rev. 2 →   +55 Hey it was a really amazing contest. The problems were really nice and used quite a good variety of concept. And also had a good and elegant solution for each problem. What happened on B is obviously not something anyone would have intended and these things are going to happen when we have so many contests. Thanks a lot for an amazing set of problems and enjoy your birthday :)
•  » » 3 months ago, # ^ | ← Rev. 3 →   -64 how much you make this round from leaking solutions? You don't even have any submission on this round and commented "amazing". Obviously to avoid revealing yourself as the leaker. What a fucking joke
•  » » » 3 months ago, # ^ |   +41 Its way more likely he participated on a alt account, considering he just got red. Kind of weird to jump into conclusions just because the guy is indian.
•  » » » » 3 months ago, # ^ |   -25 @definitelynotmee you must be new here. Tons of examples on Indian who cheated all the way to Master+ rating. The higher their ratings are the more sophisticated their cheating methods. Some even rewrote the solutions to avoid detections.But the leakers are definitely at the upper echelon. Sure it's not certainly it's him but it's likely.
•  » » » » » 3 months ago, # ^ |   +24 Justifies jumping to conclusions by jumping to more conclusions
•  » » » » » 3 months ago, # ^ |   +1 Wdym "you must be new here", lol. Respond me with your real account so we can see who's new.Anyways, I assure you the leakers are NOT at the upper echelon because through all contests I did I've yet to see a leaked problem that is above blue level. Therefore, if youre blue+ I doubt cheating would affect you in a significant way.Of course there have been cases of cheating on high rating accounts (there has even been a case of a LGM cheating by using a joint account, and they were not indian!), but they are rare and therefore dont affect the ranks that much.
•  » » » » » » 3 months ago, # ^ |   -8 I'm not going to DM you using my real account just because you ask me so.It is true that most leaked solutions are mostly blue or below, but for me for example, I had roughly 30% of the time when I'm not able to solve all of ABC, while I would solve D+ quite often, and my rating dunk at least 50-100 points at a time. It really piss me off.You are just acting skeptical because it doesn't affect you.
•  » » » » » » » 3 months ago, # ^ |   +9 If cheaters didn't exist you would lose 40-90 points instead of 50-100. What would you blame then, the authors? What about when you do bad in scenarios where there are no cheaters, like OIs?If you're inconsistent you wont climb, with or without cheaters. Not blaming random things for your failures is a requirement to improving.
•  » » » 3 months ago, # ^ |   +3 Shut up dummy, you are punching way above your weight class here. Lol
•  » » » » 3 months ago, # ^ | ← Rev. 2 →   +3 trash
•  » » 3 months ago, # ^ |   +31 Thank you very much for your kindness!!! I am really moved. We just want to share interesting ideas with others, but now it didn't bring a perfect result. I felt guilty in the past few hours, now I feel better. Thank you!!! Your kindness really warms me!!! (●ω●)
•  » » » 3 months ago, # ^ |   +8 Don't feel so guilty man. End of the day it's just an online contest and you've put in so much efforts to make such good problems. A group of 10-15 people can't be expected to think of every possible wrong solution and set pretests for all of them. Rare misses are bound to happen. Thank you so much for all the effort!!
 » 3 months ago, # |   +17
 » 3 months ago, # |   +1 Until the last 5-10 minutes I was happy with solving ABC, then suddenly hacking of problem B solution gave me a chokeslam.
•  » » 3 months ago, # ^ |   0 what's the idea to solve problem C
•  » » 3 months ago, # ^ |   0 C is easy
•  » » » 3 months ago, # ^ |   0 what's the idea ?
 » 3 months ago, # |   0 I aint able to view others solution. Is it a bug or we cant view during system testing?
•  » » 3 months ago, # ^ |   +8 You can't view neither others solutions nor tests that your solution is wrong during system testing. I think Codeforces should allow us to do this things.
•  » » 3 months ago, # ^ |   0 It is not possible to see solutions from other people during system testing.
 »