### Monogon's blog

By Monogon, history, 2 years ago,

Hello, Codeforces!

I'm very glad to invite you to Codeforces Round #658 (Div. 1) and Codeforces Round #658 (Div. 2). This contest will take place on Jul/21/2020 17:35 (Moscow time). In both divisions, you will have 2 hours to solve 5 problems (and one subtask). The score distribution will be announced closer to the start of the round.

Huge thanks to:

I've worked hard to ensure the pretests are short and the statements are strong. Remember to only read the problems that you can solve, and may you have the best of luck!

Because I know you all have so many questions, I have compiled an FAQueue

• Q: Is it rated?
• A: Yes

UPD Here is the score distribution:

Div. 2: 500 — 1250 — (1000 + 1000) — 2250 — 3000

Div. 1: (500 + 500) — 1500 — 2000 — 2500 — 3000

UPD Editorial

UPD I filled in the answer to the FAQ. Also, congrats to the winners!

Div. 2:

Div. 1:

• +2085

 » 2 years ago, # |   +660 As a tester, give Monogon contribution.
•  » » 2 years ago, # ^ |   +93 Congrats on joining in on the tester-contribution conspiracy
•  » » 2 years ago, # ^ |   -113 give you negative contribution(
•  » » » 2 years ago, # ^ |   -29 Your comment is really usefulGive you positive contribution :D
•  » » 2 years ago, # ^ |   +63 SecondThread be like, "You're welcome, Monogon"
•  » » 2 years ago, # ^ |   +38 I guess then we won't be having a screencast from secondthread.
•  » » 2 years ago, # ^ |   +39
•  » » 2 years ago, # ^ | ← Rev. 2 →   +7 Monogon, You may now change the Answer to the question ( Is it rated? ) to YES in the blog...
•  » » » 2 years ago, # ^ |   +59 gotta wait for rating changes first so I don't jinx it
•  » » » » 2 years ago, # ^ |   +2 The amount of caution you're taking really says a lot about your past.
•  » » » » 2 years ago, # ^ |   -23 Please change it to No :/
 » 2 years ago, # |   +493 As a tester, contest is bullshit.
•  » » 2 years ago, # ^ |   +188
•  » » 2 years ago, # ^ |   -29 Kuroni orz
•  » » » 2 years ago, # ^ |   -37
•  » » 2 years ago, # ^ |   -40 Awesome Comeback !!
•  » » 2 years ago, # ^ |   +16 Would be real fun if you hadn't given the reference though
 » 2 years ago, # |   +23 As a tester, I recommend reading FAQueue
 » 2 years ago, # |   +8 So many questions and so few answers...
 » 2 years ago, # |   +56 (and one subtask)
 » 2 years ago, # |   -69 Hope we don't encounter statements like Unrated and ruined, Upset and demotivated from mike.
 » 2 years ago, # | ← Rev. 2 →   +172 Please use original FAQueue . Don't change. Spoiler
•  » » 2 years ago, # ^ |   +84 So this dude's pc is filled with screenshots I guess
•  » » » 2 years ago, # ^ | ← Rev. 3 →   +28 "A picture is worth a thousand words" Here we go again :)
•  » » » » 2 years ago, # ^ |   +73 Is this picture even relevant as reply to my statement or you just used it to prove that we are too dumb to understand xD
•  » » » » 2 years ago, # ^ |   +32 Its like Div2 F for me, can you please explain this image
•  » » » » 2 years ago, # ^ |   +9 "Ending racism by going vegan"
•  » » » » » 2 years ago, # ^ | ← Rev. 3 →   +5 False. SpoilerCheck revisions. Or check image source (you can do it by opening in new tab). Just a random image. Don't think much. A picture is worth a thousand wordsThey do 2 jobs at once -1. People can easily see I'm not the original author.2. People can easily find who is the original author. Helps me in giving due credits to the original author.
 » 2 years ago, # |   -53
 » 2 years ago, # |   +304 When you realize that Pretests are short and Statements are strong. ;-;![ ]()
 » 2 years ago, # | ← Rev. 2 →   -63 Gonna be an amazing contest.
•  » » 2 years ago, # ^ |   +87 No shit sherlock
•  » » 2 years ago, # ^ |   -14 Chandler’s every comment is considered sarcastic these days
•  » » » 2 years ago, # ^ |   -11 Can you be any wrong?
 » 2 years ago, # |   +52 Remember to only read the problems that you can solve New thing in the announcement
•  » » 2 years ago, # ^ |   +1 what did he mean by this ?I can't get it
•  » » » 2 years ago, # ^ |   +119 Then you shouldn't have read it.
•  » » » » 2 years ago, # ^ |   -14 Apparently it's to lessen the server load on cf
•  » » » 2 years ago, # ^ | ← Rev. 2 →   0 .
 » 2 years ago, # | ← Rev. 2 →   +3 Hope to get some relief after the deadly Div2 round #657.
 » 2 years ago, # |   -44 Meanwhile
 » 2 years ago, # |   +118 As a participant, I can ensure that good coders will have increased rating at my rating's expense. ;)
•  » » 2 years ago, # ^ |   -49 :(
 » 2 years ago, # |   +104 did I read it right?
•  » » 2 years ago, # ^ |   +156
•  » » » 2 years ago, # ^ |   +19 Thanks to this, my potato brains took so long to understand the reversed statement :P
 » 2 years ago, # | ← Rev. 2 →   +110 Why not this? (it's more accurate tbh) Huge thanks to DeadlyCritic for being useless, and doing nothing, and not helping with problem in any kind.
•  » » 2 years ago, # ^ |   +281 Don't be so hard on yourself. It would be difficult to write good test cases without someone to fail all the problems.
•  » » » 2 years ago, # ^ |   +36 I ruined your unrated round, now it has non-zero chance to be rated, I'm so sorry about it. =(
•  » » » » 2 years ago, # ^ |   -27 Don't reveal that contest is unrated, only testers should know that (for now)
•  » » 2 years ago, # ^ |   -12 ????????????????????????????????????
 » 2 years ago, # |   +25 Where's the Monogon Platform?
 » 2 years ago, # |   +77 As a tester, this contest is unrated (for me).
•  » » 2 years ago, # ^ |   -16 That is so obvious. "As a tester" is trending on Codeforces.
 » 2 years ago, # |   -77 As an astrologist, I predict long queues again. XD
 » 2 years ago, # |   +10 getting a hunch that this one is going to be one hell of a ride or maybe 567 is still haunting me who knows
•  » » 2 years ago, # ^ |   +1 I think the previous round got into your head just too much that you can't even remember the Round number correctly!! #Round 657
 » 2 years ago, # | ← Rev. 2 →   -15 Older guys, please tell me if Mike Mirzayanov cares about mentions in comments
•  » » 2 years ago, # ^ |   +1 Guys?! :////
 » 2 years ago, # |   0 "Remember to only read the problems that you can solve"
 » 2 years ago, # |   +282 Isn't it true Monogon ?
•  » » 2 years ago, # ^ |   +119 You know it’s true because his face matches Monogon’s profile picture
 » 2 years ago, # |   0 Such a great FAQ!!!
 » 2 years ago, # |   +151
 » 2 years ago, # |   +45
•  » » 2 years ago, # ^ |   0 Short pretests(x)Short but strong pretest with multi tests
•  » » 2 years ago, # ^ | ← Rev. 2 →   -11 If anybody interested with memes, come here.
 » 2 years ago, # |   0 Finally, Monogon is back!
 » 2 years ago, # | ← Rev. 2 →   -40 Hello, I got quetion, in the problem D the test case include el case asdfghjk and the answer is 7, but the answer but the answer shouldn't be 6?. The string of the answer would be ddddgfeesorry, ignore me, I was wrong about competition blog
 » 2 years ago, # |   -20 Codeforces is very good!There are three to four competitions a week!
 » 2 years ago, # | ← Rev. 2 →   0 what does a short pretest mean? Less tests or just easier pretests? edit: sorry if im misinterpreting something or if theres some nuance but it would be really helpful if someone could answer instead of just downvoting
•  » » 2 years ago, # ^ |   0 "short pretests and strong statements" is a joke, it should have been "strong pretests and short statements"
•  » » » 2 years ago, # ^ |   +19 ah ok no wonder i couldn't understand any of the memes. Thanks!
 » 2 years ago, # |   +7 I've worked hard to ensure the statements are strongDon't tell me it's 2 hours of thinking for 4 lines of code..
 » 2 years ago, # |   +2 all they are attempting to do is demotivate contestants and cause fewer people to participate
 » 2 years ago, # | ← Rev. 2 →   -26 [Deleted]
•  » » 2 years ago, # ^ |   +27
 » 2 years ago, # |   -67 I'm very sorry to say but this round is going to be unrated
 » 2 years ago, # |   +5 This month is already a disaster(in terms of our heartbreak during contests). I hope this contest will conduct smoothly. All I want to not see that popup message from mike! Let's hope for the best
•  » » 2 years ago, # ^ |   +3 your wish is granted!
 » 2 years ago, # |   +28 Wow, Monogon is this you?
•  » » 2 years ago, # ^ |   0 Thanks. I can't believe you made me waste my time watching yoyo videos on Youtube
•  » » » 2 years ago, # ^ | ← Rev. 3 →   +24 communicating in internet is tough
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   +22 Bruh!It was about me watching anything. not blaming you. I found yoyo weirdly satisfying and ended up watching for like 30-60 mins xD (some 3A, 4A finals and stuff). It was a joke and wasn't blaming you, was instead thanking you lol.
•  » » » » » 2 years ago, # ^ | ← Rev. 2 →   +1 Ok, I got it now, sometimes it's hard to figure out the tone of the voice in a internet chatbox :v
•  » » » » » » 2 years ago, # ^ |   +6 As someone rightly said :-)"communicating in internet is tough"
•  » » 2 years ago, # ^ |   0 I found another one, by Eva. I'm not 100% sure if both they are same, although they look same and have same name.
•  » » » 2 years ago, # ^ |   +3 rotavirus can u plz confirm this?
•  » » » » 2 years ago, # ^ |   +8 It's my kind twin
•  » » » » » 2 years ago, # ^ |   -12 She's *
•  » » » » » 2 years ago, # ^ |   +10 Never heard of twins having identical names.
•  » » » » » » 2 years ago, # ^ |   +15 that's the joke
•  » » » 2 years ago, # ^ | ← Rev. 2 →   -16 Does it matter? I won't be surprised if I get to know that the real person behind rotavirus is a male. Who knows maybe he got crush on this singer Eva Krauze and made an account in her name.
•  » » » » 2 years ago, # ^ |   +16 Why have you created a new account to say this
•  » » » » » 2 years ago, # ^ |   -26 Isn't this obvious? Ms/Mr rotavirus
•  » » » » » » 2 years ago, # ^ |   +2 It's not obvious for me. Once again, why do you need a new account?
•  » » » » » » » 2 years ago, # ^ |   -11 coz I forgot password of my original account 😏
•  » » » » » » » » 2 years ago, # ^ |   0 Why haven't you, grammar Nazi, corrected "obvious to me"?
•  » » » » » » » » » 2 years ago, # ^ |   0 Cuz I did not want to.
•  » » » » 2 years ago, # ^ |   0 still eva's personality is kindda cool.
•  » » » » » 2 years ago, # ^ |   0 What's cool about his/her personality?
•  » » » 2 years ago, # ^ |   0 Is that the old version of TikTok?
 » 2 years ago, # | ← Rev. 4 →   -40 Great contest
 » 2 years ago, # |   0 What is mean by one subtask?
•  » » 2 years ago, # ^ |   +30 One problem have easy and hard version *
 » 2 years ago, # |   -10 constructiveforces!!!
 » 2 years ago, # |   0 Hope for a challenging round despite the toughness of the previous one!
 » 2 years ago, # |   +4 Hope to become a master after this round.
•  » » 2 years ago, # ^ |   0 Best wishes to you mate!
•  » » 2 years ago, # ^ |   0 I am getting OCD from your graph since you are almost at the border between purple and orange.
 » 2 years ago, # |   +3 Reading the blog, this looks to me a very different contest than usual. Really excited for this one!
 » 2 years ago, # |   0 Monogon how many shared problems will be?
•  » » 2 years ago, # ^ |   +92 div2(C+x) = div1(A+x), so 3 shared problems.The subtask is on div2C = div1A, so it is also shared.
•  » » 2 years ago, # ^ |   -15 -1
 » 2 years ago, # |   -42 is it rated.
 » 2 years ago, # | ← Rev. 2 →   -48 do you guys know when will they announce the answer of this (Q Is it rated?). If announced can you leave the link below? If it's not rated I would rather virtual this round because in my time zone it's late night. Thanks!
•  » » 2 years ago, # ^ |   0 Answer will be available after the round . 
•  » » » 2 years ago, # ^ |   -34 is there a link that announced it will be available after the round?
 » 2 years ago, # |   -66
 » 2 years ago, # |   +16 What does it mean by (1000+1000) in score distribution of div2?
•  » » 2 years ago, # ^ | ← Rev. 2 →   +16 Subtasks: C1 & C2 are worth 1000 each, so C is worth 2000 overall.
•  » » 2 years ago, # ^ |   +40 div2C has an easy version and a hard version. Each version is worth 1000 points, so 2000 total.
 » 2 years ago, # |   0 I'm new to cf, but why do they tell you do only read problems you can solve?
•  » » 2 years ago, # ^ |   +62 Because if you know you can't solve them, why waste the website's precious resources by requesting for the problem page?It's codeforces new strategy to reduce server load.
•  » » » 2 years ago, # ^ |   +6 oh I see
•  » » 2 years ago, # ^ |   +10 They meant "only solve the problems you can read".
 » 2 years ago, # | ← Rev. 3 →   -48 This score distribution it is looks a little scary! I hope it will be a good contest! Good luck everyone!! SpoilerUPD : What I meant by shares is that problem B is more difficult than problem c1 and the problem c1 is the same as problem a1 in Dev 1. Also, there is a big difference between the points of some successive problems in div1 and div2
 » 2 years ago, # |   +13 After seeing score distribution Good luck with question B.
 » 2 years ago, # |   0 I'm not strong enough to compete with all of you >_
•  » » 2 years ago, # ^ |   +9 Is that #657 that got you demotivated?
•  » » » 2 years ago, # ^ |   0 No, I just mean that I'm so stupid. I always be stupid. I need to learn English again, not programming.
•  » » » » 2 years ago, # ^ |   0 Or you can learn Russian instead. xD
•  » » » » » 2 years ago, # ^ |   0 Yeah, maybe. I'm looking forward to learn Russian. If I have time, I will try it, it will be fun! :D
 » 2 years ago, # |   +90 In div2, D is worth 12% more than C (that's 2250 vs 2000 points). In div1, those two problems differ by 50% (1000 vs 1500 points). Maybe these two fractions shouldn't be equal but should they differ that much? I don't think so.#geometricprogressionmatters
•  » » 2 years ago, # ^ |   -7 well in div2 people usually solve problems in order a b c d etc . and it takes time to solve c1 and c2 and that time is gonna be counted for both of the problems . (penalty would be too much for c1+c2) i think its the reason .
•  » » » 2 years ago, # ^ |   +10 You ignored the fact that penalty is in proportion with the problem points.
•  » » 2 years ago, # ^ |   -24 And till now, I used to think there was separate leaderboard for div 1 and div 2
•  » » 2 years ago, # ^ |   0 are you participating today?
 » 2 years ago, # |   +9 awaiting a good round
 » 2 years ago, # |   -27 Hope,It will be a great round and we all get high rating, in shaa allah.
•  » » 2 years ago, # ^ | ← Rev. 3 →   +12 .
 » 2 years ago, # |   -8 so your compiler of FAQ didn't show any output !
 » 2 years ago, # |   0 System test would be a disaster today. Why?
 » 2 years ago, # |   -7 Hope this will be rated
 » 2 years ago, # |   0 For no reason I hate subtasks. :/
 » 2 years ago, # |   +6 Remember : Only read the problems that you can solve. If you can't solve it, don't read it in the first place.
•  » » 2 years ago, # ^ |   +26 Interestingly, all 4 of these are helpful advice: Remember to only read the problems that you can solve (waste of time) Remember to only read the problems that you can read (waste of time) Remember to only solve the problems that you can solve (waste of time) Remember to only solve the problems that you can read (you won't solve it anyway)
 » 2 years ago, # |   -42 is it rated ??
 » 2 years ago, # |   0 Problem page for me keeps loading.. It's showing nothing
 » 2 years ago, # | ← Rev. 2 →   -6 Problems are great, I wish the queues don't get really long this time.
 » 2 years ago, # | ← Rev. 2 →   0 .
 » 2 years ago, # |   0 cbcfbg
 » 2 years ago, # | ← Rev. 3 →   -9 I had a correct answer to C1 and I resubmitted by mistake because I had both C1 and C2 open and I was trying to submit to C2 the improved solution. This cost me 200 points :((( ( I submitted C1 after 30 minutes and the second one was after an hour)
•  » » 2 years ago, # ^ |   0 Same with me. Isn't only the first accepted submission supposed to count? Or have the rules changed? :(
•  » » » 2 years ago, # ^ |   0 But pretests passed does not mean it will always pass system testing. The initial solution may not be totally correct so one might want to resubmit a better solution that also passes pretests, but would also pass system testing.In addition, haven't the rules always meant that resubmission costs 50 points no matter what?
•  » » » » 2 years ago, # ^ |   0 I didn't know the rule clearly then. I thought every pretests passed submission is tested against main tests.
•  » » » » 2 years ago, # ^ |   +3 Well it would be nice if you could choose (the default is the last one, but you can choose a previous revision).
•  » » 2 years ago, # ^ |   0 In D won't the answer of last test case be YES?If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .
•  » » » 2 years ago, # ^ | ← Rev. 4 →   0 No, because 11 and 9 have to be in the same array. The big observation is that if there is a maximum up to now (which 11 is), then until you pass that max, all of the following elements must be in the same array as the max. That's because if they are smaller, and they were in the other array, they would have been picked before the max.Think about your example. after 4 3 2 5 1 where chosen, there could be two scnarios:a = 11 ...b = 9 ...or:a = 11 9 ...b = ....The first case CAN'T happen, because 11 was picked, so 9 has to be in the same array with 11.My solution simply groups together elements that have to be in the same array, and then I create an array of the number of elements that have to be grouped together. in the last test case, the list of elements is [{4,3,2}, {5,1}, {11,9}, {12,8,6,10,7}] which turns into [3,2,2,5] Now each of these groups can be assigned to any array, so you need to find a subset of elements who's sum is equal to n, which is the subset sum problem. Then I copied this dp solution: https://www.geeksforgeeks.org/subset-sum-problem-dp-25/And all you have to do is use this function and return "Yes" if True or else "NO". My solution: Spoiler(given that I copied isSubsetSum from geeksforgeeks): def solution(a,n): l = [] curr_max = a[0] curr = 1 for x in a[1:]: if x < curr_max: curr+=1 else: l.append(curr) curr = 1 curr_max = max(x,curr_max) if sum(l) < 2*n: l.append(curr) return 'YES' if isSubsetSum(l,len(l),n) else "NO" 
•  » » » » 2 years ago, # ^ |   0 Thanks bro.
 » 2 years ago, # |   -33 Hmmpfffh! Totally disappointed by the explanation of Problem C. It's been 20 minutes and still not able to understand it fully.
•  » » 2 years ago, # ^ | ← Rev. 2 →   +3 What part of it do you not understand? In one operation you take some prefix, flip the bits and reverse it. Then you want to turn string a into string b in 3n operations (or 2n, for the second subtask).
•  » » » 2 years ago, # ^ |   -16 It wasn't clearly mentioned that we'd to reverse and then flip the bits (doing vice versa would yield different results!). Overall, it was a confusing statement but a nice question.
•  » » » » 2 years ago, # ^ | ← Rev. 3 →   +5 Can you give an example of a string such that reversing the bits and then flipping them produces a different string than flipping and then reversing them? HintIs flipping the bits dependent on order in any way?
•  » » 2 years ago, # ^ |   0 It was well explained. But not so easy to find the logic(at least for me)
 » 2 years ago, # |   0 I have submitted code B twice. Then I realize the first code was not wrong. Is there any way to cancel the last submission? My rating has changed a lot because of the last submission.
•  » » 2 years ago, # ^ |   +8 No. There is no way to cancel any submission.
•  » » 2 years ago, # ^ |   0 i think you can lock one of your submission for judging. on submission tab there is lock icon.
•  » » » 2 years ago, # ^ |   0 Are you sure that it can help?
•  » » 2 years ago, # ^ |   0 It won't change A LOT.
 » 2 years ago, # |   0 Nice problemset! Really enjoyed the contest! :)
•  » » 2 years ago, # ^ |   0 In D won't the answer of last test case be YES?If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .
•  » » » 2 years ago, # ^ |   0 It would give 4 3 2 5 1 9 11 12 8 6 10 7. Which is different from the last test case. Also, don't leave your comment under other's comment.
•  » » » 2 years ago, # ^ |   0 merge(a,b)= [4,3,2,5,1,9,11,12,8,6,10,7] not [...11,9...]
 » 2 years ago, # | ← Rev. 2 →   0 My Video solution for Problem B. Hope you Like It.
 » 2 years ago, # |   +18 Am I the only one who solved Div1A2 using Treap? Solution: smash me
 » 2 years ago, # | ← Rev. 2 →   -38 😩😩😩😩please make contests harder, this one wasn't fun
•  » » 2 years ago, # ^ |   +13 previous one was pretty hard :p
•  » » 2 years ago, # ^ |   +31 Speaking for div1, lots of contestants only manage to solve A or A+B, and the competition boils down to solving these 2 faster (=typingforces) — and the scoring distribution among the second half of participants doesn't reflect their skills. Harder contests will make this even more problematic.
•  » » » 2 years ago, # ^ |   -21 oh i forgot to look at the standings and realize C wasn't easy
•  » » » » 2 years ago, # ^ |   +8 Out of curiosity, is C the type of problem you have been advocating for? It seemed to be a pretty good example of easy solution, nontrivial implementation (assuming my solution is correct).
•  » » » » » 2 years ago, # ^ |   -17 implementation was trivial, sorry
•  » » » » » » 2 years ago, # ^ |   0 :’( I should learn how to code
•  » » » » » » 2 years ago, # ^ |   0 Either we're talking about different problems or we have a different notion of what trivial is
•  » » 2 years ago, # ^ |   0 how did you manage to get WA on A1 and AC on A2?
•  » » » 2 years ago, # ^ |   0 I submitted different codes
•  » » » » 2 years ago, # ^ |   0 oh yeah, I saw they were slightly different, so wondering what the key difference was
•  » » » » » 2 years ago, # ^ |   -34 i don't know, check yourslef
•  » » » » » » 2 years ago, # ^ |   +5 Hmm.. now I think those two smiley faces in your profile actually symbolise two people on one profile.Adam and Eva
•  » » » » » » 2 years ago, # ^ |   -15 Yourself* You're pathetic
 » 2 years ago, # |   +1 How to solve C2? Was it based on a similar technique as C1 with optimization, or an entirely new way?
•  » » 2 years ago, # ^ |   +1 Instead of reversing string i access string form back and front(using deque). Everytime making a character equal i remove that from a and b. And i handle flip of bit using equal and not equal.
•  » » 2 years ago, # ^ |   +1 Use two pointers
 » 2 years ago, # |   0 Please, someone, help me with C2. Thanks in advance
•  » » 2 years ago, # ^ |   +4 make a either all 0 or all 1 than solve it from the last index
•  » » » 2 years ago, # ^ |   0 Yaa that I get but what about reversing string in each step??
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 there will be no need to reverse, think for a moment u will get the idea
•  » » » » » 2 years ago, # ^ |   +1 That's because all of them will then be either 0s or 1s. Right?
•  » » » » » » 2 years ago, # ^ |   0 exactly!!
•  » » » 2 years ago, # ^ | ← Rev. 3 →   0 this is much better what I was doing was adjusting the first index of a according to the b[i] and then reversing. before checking the value of a[i] I was just adjusting its value. I saw the patter to how I should adjust value just before 2 minutes at the end :(I missed div2 C2 by 10 sec. I am pissed i am always careless.
•  » » » 2 years ago, # ^ |   0 how do you make everything 0 or 1?
•  » » » » 2 years ago, # ^ |   0 let say we r at index i from i-i-1 a is either 0 or 1 so if i is same then we have to nothing otherwise change 0-i-1 values
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 i did it using two pointers and flag that shows the fact that s[l,r] has been reversed
 » 2 years ago, # |   0 Any hints for D?
 » 2 years ago, # |   0 Is the required and sufficient place where a snake can flip around a vertex $v$ connected to 3 disjoint paths with length >= snake length? I assumed so and looked for all such vertices $v$ which the snake can reach with its head/tail, but got WA, so I'm wondering if I have a bug or the idea is wrong.
 » 2 years ago, # | ← Rev. 3 →   -8 now after problem C1, I won't forget that "STRING IS IMMUTABLE"
 » 2 years ago, # |   +25 D1D was inspired by task from MIPT workshow (2019 day 5 B Little Worm). Both are extremely shit.
•  » » 2 years ago, # ^ |   +22 ... which is taken from Polish ICPC stage (AMMPPZ in Cracow). I was one of the organizers of that contest and I was too lazy today to search for the solution code — solving other problems seemed more fun.
•  » » » 2 years ago, # ^ |   +39 I've wasted a lot of time trying to use these codes — I think that it's hard to use them as the problem was slightly different.
•  » » » » 2 years ago, # ^ | ← Rev. 2 →   0 I've used the code for the Little Worm problem to check if we can reach a diameter. It's a bit easier to solve it if our snake is already located on a diameter.
•  » » » 2 years ago, # ^ |   +15 Well, code from that problem didn't help me much, although some parts of the solution share the same idea.Also, I liked both problems and I don't think they are too similar: in older problem, the start and finish positions were disjoint as paths, in today's problem they coincide. I hope I will not see the problem without position restrictions in a contest, though :)
 » 2 years ago, # |   0 How to solve C1 with 3*n operations?
•  » » 2 years ago, # ^ |   0 change elements of a from the end one by one
•  » » 2 years ago, # ^ | ← Rev. 2 →   0 solve from the last index if it is correct than just remove it from a if it is not make it correct with the help of 1 index
•  » » 2 years ago, # ^ |   0 I got pretests passed both subtasks with a simple greedy algorithm: Spoilermake string a all '0'. Then create string b from that.
•  » » 2 years ago, # ^ |   0 You can always use the zeroth index character for swapping. Iterate from back of first string if its different , then check for conditions.In case — the first character of first string is different from character of second string , you can just perform operation once and update the string : else you need to perform the operation two times first on the very first character of first string which makes it different from character you wanna change for in second string and then perform operation on prefix of first string of desired length.Ps: sorry for bad english!
 » 2 years ago, # |   0 need a quick editorial now
 » 2 years ago, # |   +44 Div2A, Div1B, Div1C, Div1D — Codeforces? More like YesOrNoForces(I'm actually mocking people that complain about the lack of diversity in problemset by checking similarities that are not relevant).
 » 2 years ago, # |   0 C2 is very interesting. Do we need any data structure to proceed operations?
•  » » 2 years ago, # ^ |   0 keep a variable for zeroth index character and one variable for number of reverses.Iterate from back and keep updating both of the variables as required.
•  » » 2 years ago, # ^ |   0 No, I solved it with array only. Link
 » 2 years ago, # |   0 in C-2 has anyone thought of doubly LinkedList kind of thing with a status variable?
•  » » 2 years ago, # ^ |   0 Yess. I think will enable us to solve using in 2n operations and O(N) time.
•  » » 2 years ago, # ^ |   0 I used deque
 » 2 years ago, # |   0 Do anyone know how to bitset in dynamic length?Please help. I think I got TLE on pretest 3 in C2 coz of inefficient implementation of this :/
•  » » 2 years ago, # ^ |   0 Same happened with me.
•  » » 2 years ago, # ^ |   0 No. I think the main issue is that your solutions is $O(n^2)$
•  » » » 2 years ago, # ^ |   0 Yes My code was doing in 2*n operations but time is O(n^2).
•  » » » » 2 years ago, # ^ |   0 So bitset probably won't help in this case
•  » » » » » 2 years ago, # ^ |   0 So How to resolve it or reduce the complexity?
•  » » » » » » 2 years ago, # ^ |   0 Editorial has already been released
•  » » 2 years ago, # ^ |   0 You can just keep two pointers. Its pretty fun to code it that way.
•  » » » 2 years ago, # ^ |   0 Okay Thanks @s161516 @udayan14
 » 2 years ago, # |   0 Anybody else wondering why problem B have more points than C1 ?
 » 2 years ago, # |   -11 Is it rated? :)
•  » » 2 years ago, # ^ |   +2 Fortunately yes :)
•  » » » 2 years ago, # ^ |   0 this is like Div.3 compared to the last Div.2 :)
 » 2 years ago, # | ← Rev. 2 →   0 can someone help with Problem C : 87584443as per error in TC 4, a is not transformed to b, but when I print a & b it is same ans a is transformed to b.
•  » » 2 years ago, # ^ |   0 i had the same problem Your text to link here... but the string was transformed completely
•  » » » 2 years ago, # ^ |   0 our approach & problem both are same.. LOL
•  » » » 2 years ago, # ^ |   0 Hello Rishabh, We both made a foolish mistake. reverse should be till j+1, not only j. hence last bit was not reversed. Your solution is submitted as well. check 87621865
•  » » » » 2 years ago, # ^ |   0 thank you
 » 2 years ago, # | ← Rev. 2 →   0 The sample test case explanation was enough for solving Div2-B.. but I didn't care to read it at first because I thought NIM was always based on XOR.. nvm got AC after reading it.
•  » » 2 years ago, # ^ |   0 whats your approach and what you conclude from test case?
•  » » » 2 years ago, # ^ |   0 keep comparing from n-1 to 0th bit. if mismatch found at i, compare b's i'th bit to a's 0'th bit. if both bits are same, means 2 operations required 1. operation on a at 0th bit to flip it. 2. operation on till i'th bit.if a's 0th bit and b's i'th bits are different, one operation till a's i'th bit is sufficient
•  » » » 2 years ago, # ^ |   0 "The second player should take the stones from the second pile because the first pile is empty. He will take 1 stone because he can't take any other number of stones."The first player can always force ze second player to take out any desired no of stones(which shall benefit him) in every turn , unless he is forced in the same way if there's only 1 stone to take out in the start.
 » 2 years ago, # |   -12 As expected nice problemset. Next time i will like to solve problem named Monogon and rescheduling.
 » 2 years ago, # |   0 In D won't the answer of last test case be YES?If we take A-[4 3 2 5 1 11] and B-[9 12 8 6 10 7] .
•  » » 2 years ago, # ^ |   0 No, if you merge these 2, you will get[4, 3, 2, 5, 1, 9, 11, 12, 8, 6, 10, 7] which clearly not equal.
•  » » » 2 years ago, # ^ | ← Rev. 3 →   0 Why 9 before 11 ?won't it be like 3 2 5 1 11 9 12 8 6 10 7 then we add a1 to the beginning ?I got it now. Thanks.
 » 2 years ago, # |   +3 Last div2 was like div1 and this div2 was like div3. :-)
•  » » 2 years ago, # ^ |   0 -1+1=0. "Perfectly balanced as all things should be"
•  » » » 2 years ago, # ^ |   0 Some things can't be assume to be balanced like "blood pressure" if for half of the time it is above than normal and other half of time it is below normal then you can't call a patient as normal. I think same goes for difficulties in contest.
 » 2 years ago, # |   0 Video Solution to C1 and C2. I have discussed how to solve in 2n operations and N^2 time, how to solve in 3n operations and O(N) time. Finally optimized 2n operations and N^2 time to 2n operations and O(N) time. Enjoy watching: https://youtu.be/TSr0x3EBWSgI will most likely make for D also :)
 » 2 years ago, # | ← Rev. 3 →   0 Am I only the who who get WA in problem A on test 5(System tests). It's strange. UPD 87526239
•  » » 2 years ago, # ^ |   0 In your code v[j] doesn't have to be exactly one, it should be v[j] >= 1.
•  » » » 2 years ago, # ^ |   0 Thanks, as Monogon said pretests were really short :(
•  » » 2 years ago, # ^ | ← Rev. 2 →   +3 Damn! You should be a tester.
 » 2 years ago, # |   +90 It's good to see a geometry problem from time to time, even if it's nothing new and groundbreaking :D
•  » » 2 years ago, # ^ |   +54 It's good to see Errichto in comments from time to time, even if it's.. wait what.. no.. Instead I want to see you on contests page hosting one. :D
•  » » 2 years ago, # ^ |   +9 It's good to see you in comments from time to time even if it's just for the purpose of gathering some upvotes and increasing your overall contribution through random rheoteric comments.
•  » » 2 years ago, # ^ |   0 It's good to see you solving geometry problems so easily, even when most of the people find them really hard.
 » 2 years ago, # |   -11 I think the time limit of Div.2 D is too tight. I got the right solution when it was only 30 second before finish, but get TLE disappointedly. My TLE Code
•  » » 2 years ago, # ^ |   +33 I think you should stop using memset.
•  » » » 2 years ago, # ^ |   0 I think this is a good alternative(?)
 » 2 years ago, # |   0 From many past contest, counting this one I am having a syndrome that I call "Coded Bug Free Solution after 10 mins of contest is over." Any helpful tips to get the job done without bugs within time limit??
•  » » 2 years ago, # ^ |   +43 Every time you find a bug, answer 2 questions: Why did this bug appear How do I change my coding practices so that a bug like that will never appear again.
•  » » » 2 years ago, # ^ |   0 That's a good idea. I think I should maintain a journal about it. Thank you for your advice!
•  » » 2 years ago, # ^ |   +12 I think instead of trying to code without bugs, learn how to debug.
•  » » » 2 years ago, # ^ |   0 What if I learn both to code without bug(Amortized analysis!) and also to debug.
 » 2 years ago, # |   0 How to solve Div2E?I used DP on state (i, j, s) which means merge(a[1:i], b[1:j]) (the variable s is used to determine the (i+j)-th element of p belong to a or b)Let x be the nearest index such that x > i+j and p[x] > p[i+j].Then the transition is to try to append the x-th element to a or b.I'm not sure about my solution (although pretests passed). Does anyone have another idea? ^_^
 » 2 years ago, # |   -6 I think I may finally hit purple thanks to your contest :) So thank you!I had to think hard the entire time. I especially enjoyed Div2 D. Not sure if it was the intended solution, but I ended up doing a subset sum problem on sizes of segments in the array, after realizing that the array could be split up into segments in a natural way.
 » 2 years ago, # |   +14
•  » » 2 years ago, # ^ |   0 TBH, this meme has become boring now to see in every round post
 » 2 years ago, # |   +143 Nice round imo. I think that for a long time there was no geometry and it's generally nice when problems touch various topics and ad-hocs aren't in majority. Kudos
 » 2 years ago, # | ← Rev. 4 →   0 (I already posted it but it was deep in a thread so probably people won't notice it)An elegant solution that probably works for problem D (finished it 10 seconds after contest was over so not sure :| ): EDIT: Well, it TLEs on test case 30, probably just because of python :|). Spoiler[given that the function isSubsetSum is copied from https://www.geeksforgeeks.org/subset-sum-problem-dp-25/ ] def solution(a,n): l = [] curr_max = a[0] curr = 1 for x in a[1:]: if x < curr_max: curr+=1 else: l.append(curr) curr = 1 curr_max = max(x,curr_max) if sum(l) < 2*n: l.append(curr) return 'YES' if isSubsetSum(l,len(l),n) else "NO" 
•  » » 2 years ago, # ^ |   0 PLEASE use the spoiler feature.
•  » » » 2 years ago, # ^ |   0 Done.
 » 2 years ago, # |   0 Interesting observation: when you get WA on pretest 1 on problem C (div1), if you click on your submission, checker tells you what's wrong with your output and provides some additional information (in this case, for example, that in the test case 2, x is not what it should be). You also don't get any penalty for WA1. This is kinda non-obvious, and gives some slight advantage to people who decide to check the details of the submission. Maybe we shouldn't print stuff like that in a checker?
•  » » 2 years ago, # ^ |   +16 Printing helpful information in the checker has always been preferred. But I believe it's not available during the contest, and you only see the verdict itself.
•  » » » 2 years ago, # ^ | ← Rev. 3 →   0 No, I actually saw the exact same thing during the contest too, and used it to debug my solution in the last minutes. In was definitely easier than understanding what's wrong myself.I agree that printing stuff in the checker is helpful, maybe CF shouldn't show checker output to the participants then.Anyways, thanks for the round, I liked the problems! (even though I wrote a silly N^2logN solution with N Fenwick trees on B :)
•  » » » » 2 years ago, # ^ |   +1 Why not show the output? This is the sample, so participants could very easily run their program against the case and figure out what is wrong (except if maybe they misunderstood some part of the problem, in which case it is very much in the spirit of samples to give some help as to where the issue is).
•  » » » » » 2 years ago, # ^ |   0 Well, you never really know what checker will say (just "answer is not correct", or "answer is not correct because of X"). To find out you need to get WA1 and check out the submission page, which is not obvious, and may give advantage to people who happen to do so.And output in the style of "answer is not correct because of X" can be very helpful when you are constructing the answer, and using sample 1 to see if your construction is correct.
•  » » » 2 years ago, # ^ | ← Rev. 2 →   0 It gives additional information on contest time too. Today i got it on D2C1.And i have seen this few more times before. Sometimes it helps to verify if i understand problem in wrong way.
 » 2 years ago, # |   -23 Very bad pretests in A2. Why didn't you add the max pretest? I thought that if the solution passes pretests in terms of perf, it would be accepted.
 » 2 years ago, # |   +14 Mai_madarchod_hu is in 2nd position of today's round. I am just imagining the post with the winner's list XD
•  » » 2 years ago, # ^ |   0 In his previous contest also he was in the 2nd position. lol
•  » » 2 years ago, # ^ |   +3 😂
 » 2 years ago, # |   0 I have a rating of 1282(Pupil). Just wanted to ask if Round 658Div2 will be rated for me and will it affect my graph, as it is not updated as of now. I'm new here, please let me know. Thanks
•  » » 2 years ago, # ^ |   0 It takes time, check tomorrow morning
•  » » » 2 years ago, # ^ |   0 Till then can you or anyone else tell if the round will be rated for me?
•  » » 2 years ago, # ^ |   +1 You can check your increase or decrease in rating here CF Predictor.After going to this url just select the contest from dropdown and find your name in the list.
•  » » » 2 years ago, # ^ |   +1 Thanks
 » 2 years ago, # |   0 I wish the contests would have been 2:15. Then I would have got D :((((
 » 2 years ago, # |   +51 Hello, MonogonI think the main test data for div2D is weak. Check this 87590140 for example. Input: 1 9 2 1 4 3 7 6 5 10 9 8 13 12 11 18 17 16 15 14 The answer should be YES, but this submission provides NO. Please have a look into it.
•  » » 2 years ago, # ^ |   +23 I'm sorry that the tests seem to be weak. The final standings are already out, but I can add test cases like this to the system tests so that more wrong submissions can fail in practice mode.
•  » » » 2 years ago, # ^ | ← Rev. 2 →   +3 Monogon Please add this test case as well. It seems to give NO as the output for some codes (including the one mentioned above) whereas the answer should be YES. Input:11627 1 28 2 29 3 4 5 6 7 30 8 9 10 11 12 13 31 14 15 16 17 18 19 32 20 21 22 23 24 25 26
 » 2 years ago, # |   0 recently i found a mail that described that my solution for the the problem 1382A matched with another person. But i don't know how it happens. i didn't use any online ide. i use codeblock. so it may be coincidence or something else. i hope , you got my answer
 » 2 years ago, # |   -58 I want to notify you that omaik786 is also my account . I want to grow two accounts at the same time . If handling two channels is not appropriate , notify me . I won't continue the 2nd account
 » 2 years ago, # |   +56 Thanks for the round!My screencast: https://youtu.be/VaCa0CQpYbo
 » 2 years ago, # |   +10 Monogon, Thanks for the contest! I liked it :)
 » 2 years ago, # |   0 Omg, I solved A and B and my rating is only 959 now :(
 » 2 years ago, # |   +2 This was my fifth contest and I liked it. I could have solved the unmerge problem. Ran out of time. Need to get quicker
 » 2 years ago, # | ← Rev. 2 →   0 Solution for Div 2 C1 / C2 and Div 1 A1 / A2, where k (number of steps to convert a to b) is almost equal to n. (limit of 3n and 2n given in the subtasks respectively)https://codeforces.com/contest/1382/submission/87614809
 » 2 years ago, # |   +10 The first time I solved a D and got Pretest passed, they failed system test and got TLE.....Maybe the pretests were infact short :P
 » 2 years ago, # |   0 Maybe only me can't find the operations that transform the string a into b in more than 2n steps...I think 1A1(2C1) is a little strange.Because if we fix the bits one-by-one,it's so easy to find a 2n steps in O(n) time.But the contest is nice and thank for +77 lol
•  » » 2 years ago, # ^ |   0 There were some random solutions people used, several 3*n solutions worst case, and a couple 2*n solutions that weren't optimized to n^2 in testing. Monogon posted some of them in the editorial if you're curious.
 » 2 years ago, # |   +8
•  » » 2 years ago, # ^ |   +13 1C = 1D?
•  » » » 2 years ago, # ^ | ← Rev. 3 →   -11 [deleted]
•  » » » » 2 years ago, # ^ |   +8 :(
 » 2 years ago, # |   0 Does anyone have any idea behind the reason for rolling back the ratings?Did I miss something?
•  » » 2 years ago, # ^ | ← Rev. 2 →   +4 It usually happens when some cheaters are caught, causing the rankings to be re-judged.I think the same must have happened this time too.
•  » » »