### CoderAnshu's blog

By CoderAnshu, 6 weeks ago,

Hi Codeforces!

I am pleased to invite you to Codeforces Round #793 (Div. 2), which will take place on 22.05.2022 17:35 (Московское время). You will be given 6 problems and 2 hours to solve them.

The round will be rated for participants of Division 2 with a rating lower than 2100. Division 1 participants can participate unofficially in the round.

All problems in this round were prepared by me and rivalq. We have worked on this round for a long time and hope you find every problem interesting.

I would like to thank:

Score Distribution:

750 – 1000 – 1500 – 2000 – 2500 – 2750

Good luck and have fun! See you in the standings. Make sure to read the statements very carefully.

Thanks to ak2006, video editorials for some of the problems will be available on his channel after the round.

Congratulations to winners!!

Global Top 5:

1. jiangly, superfast AK!

2. Beduardo

3. SSRS_

4. neal

5. turmax

Official Top 5:

Special mention to AwakeAnay for the only Indian to AK the round!

UPD 1: Links to video editorials of Problem B and Problem C

UPD 2: Editorial for problems A-D is here.

UPD 3: Editorial for E is added.

UPD 4: Editorial for F is added.

• +616

 » 6 weeks ago, # |   +49 AmShZ orz, The captain of Iranian testers
 » 6 weeks ago, # |   +63 CoderAnshu supremacy!
 » 6 weeks ago, # |   -60 I downvoted you. Then, your contribution was raised by 1
 » 6 weeks ago, # |   +5 Orz
•  » » 6 weeks ago, # ^ |   +1 Good luck to everyone!
 » 6 weeks ago, # |   +131 As a true cyan (tester), I would recommend you to try the next problem if you get stuck ( '◡' ) Also, if you wouldn't mind May I have your upvotes please
•  » » 6 weeks ago, # ^ |   +2 ok, vro
•  » » 6 weeks ago, # ^ |   0 Mil to gye itne saare upvotes..... XD koderkushy
 » 6 weeks ago, # |   +32 As a tester, the problems are fairly interesting and quite challenging.
•  » » 6 weeks ago, # ^ |   +14 Enjoy my upvote and Conference league next season ;-)
•  » » 6 weeks ago, # ^ |   +3 unlike your idol's club
 » 6 weeks ago, # |   +25 As a tester, I can confirm that the problems are high-quality and interesting, and cover a good range of topics, and would recommend participating in this contest.
•  » » 6 weeks ago, # ^ |   -15 Hopefully the pretests aren't as sad as the last contest
•  » » » 6 weeks ago, # ^ |   +29 Hopefully
 » 6 weeks ago, # |   +40 As a tester, I really did test the round this time.
•  » » 6 weeks ago, # ^ |   +61 Did you?
 » 6 weeks ago, # |   +3 I hope it will be great #793 div.2
 » 6 weeks ago, # |   +6 CoderAnshu lord supremacy. :)
 » 6 weeks ago, # |   +13 A contest by Indian Coder after such a long time!!! Very Excited!! Hoping that this contest turns out to be the best in recent times.
•  » » 6 weeks ago, # ^ |   0 How can you forget #782 div2 by my friend Newtech66 just a month ago?
•  » » » 6 weeks ago, # ^ |   +5 Ohh yes! Now indian are making some interesting contest. And they do all this with hectic college schedule in India.(-_-)
•  » » 6 weeks ago, # ^ |   +7 The best duos of India. (CoderAnshu and rivalq) supremacy
 » 6 weeks ago, # |   +107 As a problem setter, I would really like all of you to participate.
 » 6 weeks ago, # |   0 I hope everyone will participate so it will be fun
 » 6 weeks ago, # |   -22 i hope the round will be a bit better than previous
•  » » 6 weeks ago, # ^ |   +4 Which previous?
•  » » » 6 weeks ago, # ^ |   +3 i guess its — "Codeforces Round #792 (Div. 1 + Div. 2)" ...not your previous
•  » » » » 6 weeks ago, # ^ |   0 you're right
•  » » » » » 6 weeks ago, # ^ |   +31 This you should judge after the contest itself.
•  » » 6 weeks ago, # ^ |   +25 I hope this toxic stream will stop someday
 » 6 weeks ago, # | ← Rev. 2 →   +18 For the last two contests I have been fsting on problem D due to stupid implementation mistakes. Hopefully this contest I will be able to break the streak.(Hopefully by solving problem D ) Edit: Broke the streak by not solving D this time.:clownglasses:
 » 6 weeks ago, # |   +18 As a tester, I get to write a comment for some contribution. hue hue hue.
 » 6 weeks ago, # |   +11 Notice in the last lineMake sure to read the statements very carefully.
•  » » 6 weeks ago, # ^ |   +21 Ohh... I haven't read that.
 » 6 weeks ago, # |   +1 All the best Everyone !
 » 6 weeks ago, # | ← Rev. 3 →   +9 Hopefully the "best of 2022" which were replaced in the previous round will be seen here.
•  » » 6 weeks ago, # ^ |   0 Lolll
 » 6 weeks ago, # | ← Rev. 2 →   +1 I hope I solve about 3 problems and become a specialist !!Good luck for all participant!
 » 6 weeks ago, # | ← Rev. 12 →   +2 All the best for all participants
 » 6 weeks ago, # |   +8 As not a tester,give me contribution!
 » 6 weeks ago, # |   +59 No offense though
 » 6 weeks ago, # |   0 Everything is so sorted, just look at the testers list! Efforts put everywhere.
 » 6 weeks ago, # |   +10 Much Awaited Contest
•  » » 6 weeks ago, # ^ |   +1 of cource! it seems like very very very great contest and also much awaited.
 » 6 weeks ago, # |   0 Good luck Everyone :)
 » 6 weeks ago, # |   +1 I will be taking part in this contest.. I am getting back after nearly 1 year.. wish me good luck bois!!
 » 6 weeks ago, # |   0 This contest will be harder than previous.Good luck everybody!!!!!!!!!!!!!!
 » 6 weeks ago, # |   0 yes i hope i don't forget to read the statements carefully ..... may my mind & focus help me
 » 6 weeks ago, # |   +7 Btw, 793 is a semiprime number. Hope that means at least half of problems will be great!
 » 6 weeks ago, # |   0 Indian round will be on fire as always. Hope to solve 3 problems at least this time.
 » 6 weeks ago, # |   -6 Good luck!
 » 6 weeks ago, # |   0 All the best to everyone
 » 6 weeks ago, # |   +15 Best of luck to everyone!!
•  » » 6 weeks ago, # ^ |   +13 congrats for rank 7 in kickstart!
•  » » » 6 weeks ago, # ^ |   +5 Thanks!
 » 6 weeks ago, # |   0 I hope the rating changes will be good for everyone! Good luck!
 » 6 weeks ago, # |   0 good luck to everyone!
 » 6 weeks ago, # |   +43
•  » » 6 weeks ago, # ^ |   +11
 » 6 weeks ago, # |   +54
 » 6 weeks ago, # |   0 A problem was not easy. And i don't think so it'5 750 rated problem
 » 6 weeks ago, # |   0 I believe in CoderAnshu & rivalq supremacy!
 » 6 weeks ago, # |   +11 SwapOnPermutationForces.
•  » » 6 weeks ago, # ^ |   -19 This justifies your WA on B.
•  » » » 6 weeks ago, # ^ |   +11 Well just because I didn't initialize the answer big enough :(
 » 6 weeks ago, # |   -36 Yet another unbalanced round... #SpeedForcesOP
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +12 Wow!! You solved none. It's highly unbalanced and speedforces, sorry.
•  » » » 6 weeks ago, # ^ |   -57 Don't you know anything about alt accounts?
•  » » » » 6 weeks ago, # ^ |   +23 I know, why not comment from it directly?
•  » » » » » 6 weeks ago, # ^ |   -41 probably coz i wanna be anonymous '◡'
•  » » » » » » 6 weeks ago, # ^ |   +28 Or you are coward.
•  » » » » » » » 6 weeks ago, # ^ | ← Rev. 2 →   -6 well i knew i'm gonna have -ve contribution so why not write from alt.
 » 6 weeks ago, # |   +9 Now I can finally sit and watch my rank fall due to so many wrong submissions.
•  » » 6 weeks ago, # ^ |   +4 Yeah, me too, thought I'm a master after I became a specialist LOL
•  » » » 6 weeks ago, # ^ |   0 The difficulty rating for questions you have solved doesn't even signify how you became a Specialist!.. Anyways Congo
•  » » » » 6 weeks ago, # ^ |   0 Yeah sometimes luck plays a part too, and CF is not the only platform my friend
•  » » 6 weeks ago, # ^ |   +1 Same here lol
•  » » 6 weeks ago, # ^ |   +1 me too
 » 6 weeks ago, # |   +6 Problems are tricy ig.
 » 6 weeks ago, # | ← Rev. 2 →   +3 Would anyone please explain why the output of problem C is 7 for this input?1131 2 3 5 6 7 7 8 8 9 9 10 10Thanks.
•  » » 6 weeks ago, # ^ |   0 Put 1 in the middle.
•  » » » 6 weeks ago, # ^ |   0 Yes, got it.Thanks.
•  » » 6 weeks ago, # ^ |   0 That's 8
•  » » 6 weeks ago, # ^ |   0 10 9 8 7 3 2 1 5 6 7 8 9 10
•  » » » 6 weeks ago, # ^ |   0 Thanks.
•  » » 6 weeks ago, # ^ |   0 10 9 8 7 6 3 1 2 5 7 8 9 10
•  » » » 6 weeks ago, # ^ |   0 Thanks.
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   0 Isn't it 8 ? Below would be the optimal order: Arbitrary order1 2 5 7 8 9 10 13 10 9 8 7 6 3 1Both LIS and reverse LIS comes out to be 8Edit: This answer is for Rev. 1 of the parent comment.
•  » » » 6 weeks ago, # ^ |   0 no 13 is number of elements not in the array
•  » » » » 6 weeks ago, # ^ |   0 I understood that now. Initially I thought it is part of the array.
•  » » » 6 weeks ago, # ^ |   0 No, Here first 1 is the test case number & 13 is the number of elements.
•  » » 6 weeks ago, # ^ | ← Rev. 3 →   0 Array: 10 9 8 7 1 5 3 6 2 7 8 9 10 10 9 8 7 1 5 3 6 2 7 8 9 10In reverse: 10 9 8 7 2 6 3 5 1 7 8 9 10 My Approach if u want to knowcount the numbers that have frequency greater than 2 (lets say 'd'). and those occurring single time will be n-d (lets say 's'). and answer will be d+ (s+1)/2;
 » 6 weeks ago, # |   0 FML, I think I have the solution for E. Rip. I think it involves traversing each tree in the forest and doing a tree DP.
 » 6 weeks ago, # |   +9 Guys!! Hope you liked the round. Please share your feedback on every problem. I will be really thankful.
•  » » 6 weeks ago, # ^ |   +1 Because i solved till C, it was very great round!)
•  » » 6 weeks ago, # ^ |   -40 unbalanced and stupid problems
•  » » » 6 weeks ago, # ^ |   +1 Not fair. Frankly speaking, it happens not so often, but A was pretty. As for B, i am not a pro of bitwise operations, but even i didn't found this one too hard. And C... some stupid mistakes, but after about 30 min i did found the right solution by painting samples into notepad, so i do not think that this round was disbalanced
•  » » » » 6 weeks ago, # ^ |   0 Eeeew pupil, ofc it won't be unbalanced for you.
•  » » » » » 6 weeks ago, # ^ |   +4 What, how did ya call me????????? I am a specialist now, baby!!!!!!!!!!!!!!!!!!!
•  » » » » » » 6 weeks ago, # ^ |   -15 Nice! Specialist after 41 rounds. Good job lmao.
•  » » 6 weeks ago, # ^ |   +5 I was able to solve till $C$, and it felt okay, I had almost got $D$, it was a nice constructive problem, and I don't know why I was getting WA on test 2. It would be really helpful if anyone can explain what does this means ? I got this on $D$My submission: https://codeforces.cc/contest/1682/submission/158075759
•  » » » 6 weeks ago, # ^ |   +6 I guess there is a problem in amount of your edges, the compiler is trying to say you have to print another edge, but your code started to answer on the next test case, so you probably don't have enough edges printed. Sorry if I'm wrong
•  » » » » 6 weeks ago, # ^ | ← Rev. 2 →   +3 Yeah, you were right, thanks for your help, I got one test case failing "100100100100", and now it got accepted :)It's a very sad thing that I wasn't able to find this basic test case during the contest..
•  » » » » » 6 weeks ago, # ^ |   0 You are welcome:)
•  » » 6 weeks ago, # ^ |   0 good problems I solved till C (I was lucky), problem D was good but I didn't get any idea how to solve it (waiting for editorial), nice problems keep it up, and thanks for the round.
•  » » 6 weeks ago, # ^ |   0 strong pretests for most of the problems and very clarifying statements .thanks for the round.
•  » » 6 weeks ago, # ^ |   +1 Questions are very interesting. From B to D all of them involved a decent amount of thinking. Loved the round.
•  » » 6 weeks ago, # ^ |   0 I got TLE for using unordered_map instead of map in C... Bad contest :(
•  » » » 6 weeks ago, # ^ |   0 me too
•  » » 6 weeks ago, # ^ |   0 sorry @CoderAnshu, I was upvoting but my mouse sucks, I accidentally clicked on downvote, I am sorry for it. hope you don't mind it
•  » » » 6 weeks ago, # ^ |   0 Nobody cares about your downvote.
 » 6 weeks ago, # |   0 LinearForces :-)
 » 6 weeks ago, # |   0 C felt kinda tricky.
 » 6 weeks ago, # |   +3 Why does the number of solvers of problem C go so high?
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +3 I solve it by luck.
•  » » » 6 weeks ago, # ^ |   +6 The contest wasn't balanced. Problem A and B were too easy and problem C was tricky.
 » 6 weeks ago, # |   +16 I can solve D quickly, but I can't handle A,B,C.It's weird.
•  » » 6 weeks ago, # ^ |   0 how to solve D?
•  » » 6 weeks ago, # ^ |   0 god damn stupid greedy thought always messes up my first three problems. Well it sometimes works, but the moments it doesn't work really affect my mind.
 » 6 weeks ago, # |   +32 amazing samples guys
•  » » 6 weeks ago, # ^ |   +1 True. It saved me a lot of time
 » 6 weeks ago, # |   0 What's the solution to D?
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +7 I create egdes as a circle, find a edge to remove, then for each two node (x, y) I need to change the degree, I remove the edge of (y, y + 1) and add the edge (x, y + 1) 158057894
•  » » » 6 weeks ago, # ^ |   0 amazing simple solution! I have done a garbage code, by using link list and removing subgraphs of size 3 from boundary. In the end size 3 or 4 graph remains which is handled separately.
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +12 If number of $1$'s is odd or there are no $1$'s at all the answer is "no", because the sum of degrees should be even (each edge is considered in $2$ degrees) and we should have at least $2$ leaves.To construct a solution, if the string is all $1$'s, just choose anyone of them to be the root and connect it to all the other nodes.Otherwise, connect each $0$ to the node before it ($0$ at node $1$ is connected to node $n$). Now we have chains starting with $1$ and ending with $0$ (call such endpoints "tails"). To make all the nodes in these chains valid, we have to connect odd number of edges to the tails.To do so, if all the $1$'s are consumed in the chains, just connect the tail of any chain to the tails of all the other chains. Otherwise, choose any unconsumed $1$ and connect it to all the chain tails and to any other unconsumed $1$.Such construction guarantees that no intersections occur, as we first add some edges between adjacent nodes (can't be intersected) and at the end we choose only one node and connect it to some other nodes.Submission
 » 6 weeks ago, # |   0 can anyone explain that how to solce c :*
•  » » 6 weeks ago, # ^ |   0 I just binary searched the answer. You can in linear time check whether an answer X is possible. Although I have to say it was tricky to implement, two WA submissions and like 30 minutes debugging for edge cases
•  » » 6 weeks ago, # ^ |   +7 All numbers that appeared two or more times can appear in LIS of both original and reversed array. Then we distribute all numbers that appeared only once evenly in LIS of original array and reversed array. Note that we can share one number in both LISs, so the answer is x + (y + 1) / 2 where x is the number of numbers that appeared two or more times, and y is number of numbers that appeared once.
•  » » 6 weeks ago, # ^ | ← Rev. 3 →   +4 I just count how many number appears 2 times or more as m2, 1 time as m1 and the answer is m2 + (m1 + 1) / 2.Example: 2 2 3 4 5 6 6 -> 2 3 6 5 6 4 2
 » 6 weeks ago, # |   0 Spent near one hour on E and then realized I made the wrong observation. I think A-E are all great problems.
 » 6 weeks ago, # |   +17 Those who solved problem C with unordered_map, depending on the compiler version, fall on test 26 or 28. Test 28 is a my hack test :)
•  » » 6 weeks ago, # ^ |   +10 Thanks
•  » » » 6 weeks ago, # ^ |   0 lol
 » 6 weeks ago, # |   +8 I think Problem B was slightly confusing in my opinion.I am not able to understand B problem clearly.
 » 6 weeks ago, # |   +18 how to solve E?
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +3 Build a graph with $(x_i, y_i)$ as edges. For each i, find path from $i$ to $a_i$. A pair $(x, y)$ can be swapped if the edge $(x, y)$ is the end of two paths. Edit: add code 158085317
•  » » » 6 weeks ago, # ^ |   +3 By "...the end pf two paths" do you mean the path where all of it's subtree nodes are located in their correct position?
•  » » » » 6 weeks ago, # ^ |   +4 Sorry I don't get what you mean but I just realized that it may be beneficial to name an edge with its index rather than its two end points since vertices are moving. Let's say the path from $i$ to $a_i$ consists of edge $e_{b_1}, e_{b_2}, \dots, e_{b_n}$, and path from $j$ to $a_j$ consists of edge $e_{c_1}, e_{c_2}, \dots, e_{c_m}$. If $e_{b_n} = e_{c_m}$, we can swap that edge. Then remove that edge from the end of two two paths and look for another edge that is the end of some two paths.
•  » » » » » 6 weeks ago, # ^ |   +3 I see. But how do you do it in linear time for checking i and j?
 » 6 weeks ago, # |   +52 Great round! Especially enjoyed E and F.
•  » » 6 weeks ago, # ^ |   +8 Thanks!!
•  » » 6 weeks ago, # ^ |   0 orz
 » 6 weeks ago, # |   0 Good luck for everyone!:)
 » 6 weeks ago, # | ← Rev. 2 →   0 i literally did c in 8 minutes by using same approach as in editorial but was not confident enough and waited for it to fail main tests. but it passed :) edit: people made it hard just because it is problem "C". conclusion: don't judge a book by its cover
•  » » 6 weeks ago, # ^ |   0 that's so true, i suppose C can be easier than B for those who have no idea what bitwise is
 » 6 weeks ago, # |   0 Great problems, although didn’t solve E.
 » 6 weeks ago, # |   0 Why unordered map gives tle on codeforces?
•  » » 6 weeks ago, # ^ |   0 Hash collision resulting in O(n) per access?
•  » » 6 weeks ago, # ^ |   0 Mp.reserve(1024); Mp.max_load_factor(0.25); adding these under map declaration should avoid hash collision
 » 6 weeks ago, # | ← Rev. 3 →   +12 is CF getting harder or people are getting so much better? Feels like an 1800 rate problem a few months ago would be just 1600 now. So many solved C
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   0 This is happening everywhere. Just look at AtCoder ABC contests and you will see that newer ones are getting harder.It's just a natural progression of things.
•  » » 6 weeks ago, # ^ |   +9 Or There are many cheaters.
•  » » 6 weeks ago, # ^ |   0 It's actually case3: The question was easy
 » 6 weeks ago, # |   -10 bullshit pretest for C
•  » » 6 weeks ago, # ^ |   +3 Why would you use an unordered map when it is quite easy to exploit the hash collisions for it lol
•  » » 6 weeks ago, # ^ |   +12 Congratulations!! You've reached the time which every coder reaches where he switches from hash map to map
 » 6 weeks ago, # |   +2 Ratings updated preliminarily. We will remove cheaters and update the ratings again soon!
 » 6 weeks ago, # |   +20 Here is some feedback, loved the round overall! I think BCD in particular are excellent. AI didn't really like this task. I think the solution is obvious, but takes some time to prove. Here's my proof (which avoids odd/even casework! but is very "analogy-dependent"): imagine that each letter is a colored block arranged in a line. The string being a palindrome implies that placing a mirror at the midpoint of the line is indistinguishable from the original arrangement. WLOG, suppose we remove a block not in the middle segment of same-colored blocks that is to the right of the mirror. The mirror should be moved half a block's length to the left. Now the segment of same-colored blocks to the left of the mirror is strictly smaller than the segment of same-colored blocks to the right of the mirror, which means that the resulting string cannot be a palindrome.I think coming up with this proof is much harder than coming up with the solution to the problem (there is also the less-clever parity casework proof, but I find it cancerous to think about). In general, I don't like it when there is a large difficulty gap in proof difficulty and problem difficulty. Especially for problem A, where I feel like it should be solved instantly. BVery good problem! Don't have much to say, I think it's very cute. CAnother very good problem! I like the fact that the samples don't include a case where the two subsequences must share one element in common, which penalizes proof by AC. I think the proof for this is quite long, but it flows so naturally and has many parts that can be done fast with intuition, so the difficulty of finding it is good. Extremely fun to think about overall. DAlso don't have much to say here, I think the construction is extremely nice and beautiful. EI enjoyed thinking about this. I think the solution I submitted is almost correct, but when doing a swap, I only check if the parent has the correct value needed to fill the "hole" in the subtree. Was panic-implementing at the end hoping I could submit in time though, so will have to think about it more.
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +1 Thanks a lot for the feedback!! Glad you liked the problems.
 » 6 weeks ago, # | ← Rev. 4 →   -7 Is it just me or do these submissions look so similar? - https://codeforces.com/contest/1682/submission/158041174 - https://codeforces.com/contest/1682/submission/158063005 - https://codeforces.com/contest/1682/submission/158043928 - https://codeforces.com/contest/1682/submission/158045408I think C was quite tricky, with the number of ACs, either I am dumb or there are a lots of cheaters.They have very similar code structures, and declare the same variable name, conveniently on the same lines, and they are all submissions from the same place.
•  » » 6 weeks ago, # ^ |   0 Tbh I felt the same. Usually C problem has 2-3k solves during the contest but this time it was more than 4k. Maybe some cheaters got code from somewhere or I wasn't able to think properly.
•  » » » 6 weeks ago, # ^ |   0 some guys are involved in cheating.
 » 6 weeks ago, # |   0 why TLE?
•  » » 6 weeks ago, # ^ |   0 Because you use unordered_map
•  » » » 6 weeks ago, # ^ |   0 Doesn't it satisfy time constraints(nlogn)? I have used it many times. What else should we use then here? (sorting would have also taken nlogn)
•  » » » » 6 weeks ago, # ^ |   +5 unordered_map for int can degenerate to O(n) for lookup/insert (map is guaranteed O(log n)).But yes, sorting and then linear pass will work too.
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +5 you can read this blog for efficient using of unordered_map
•  » » 6 weeks ago, # ^ |   0 check this
 » 6 weeks ago, # |   +6 Nice round, loved the problems.
 » 6 weeks ago, # | ← Rev. 2 →   +4 Why the guy's submission is so werid? https://codeforces.com/contest/1682/submission/158020409update: also this guy's submission: https://codeforces.com/contest/1682/submission/158055059
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   +16 his non-contest submissions are actually normal. Obviously use comment to bypass the plagiarism detector. I think in the past several months, they have found a way to trick the CF cheat detectors. That's why there are so many ACs for easy to medium problems now.
•  » » » 6 weeks ago, # ^ | ← Rev. 2 →   0 [deleted]
 » 6 weeks ago, # |   +4 such a poor round wasted 2 hours
•  » » 6 weeks ago, # ^ |   0 *Doesn't solve any problem and calls the contest poor. Interesting.
•  » » » 6 weeks ago, # ^ |   0 see past contests also dont judge by single contest
•  » » 6 weeks ago, # ^ |   0 Well it was nice round buddy although questions were bit tricky :)
 » 6 weeks ago, # |   0 A should have been little easier :( I wasted more than 20 mins thinking there should be easier solution for A by having right one in my mind. Lesson learnt: Solve what comes to your mind first for A atleast
•  » » 6 weeks ago, # ^ |   0 learnt this lesson long before
•  » » » 6 weeks ago, # ^ |   0 nope, it's not reflected in todays contest!
 » 6 weeks ago, # |   0 In 3rd Problem, If the array a = [1,2,2] , Then according to codeforces, correct answer is 2. Can anyone explain how is it possible. My Claim : Answer should be 1 and not 2 since it is asked "strictly increasing".Thanks in Advance !!!
•  » » 6 weeks ago, # ^ |   0 2 1 2
•  » » » 6 weeks ago, # ^ |   0 What about array [6,5,3,3,6]?
•  » » » » 6 weeks ago, # ^ |   0 answer should be 3: we can rearrange array like: 6 3 5 3 6
•  » » » » » 6 weeks ago, # ^ |   0 Sorry, my bad I thought subsequence needs to be contigous. Thanks for the help bro.
•  » » » » 6 weeks ago, # ^ |   0 3 6 5 6 3
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   0 a = 2 1 2 a' = 2 1 2 (reversed)second and third element form LIS edit: Boy but you got it in the Contest? Hopefully it's only due to luck
•  » » » 6 weeks ago, # ^ |   0 Hi,I also have similar doubt, we also need to check that the singleton element which we are considering to add in both the sequence should be either minimum or the maximum element otherwise we won't be able to add it in both the sequences.
•  » » » » 6 weeks ago, # ^ |   0 a = 1 3 2 3 1 (LIS)a = 1 3 2 3 1 (LDS)2 is neither max nor min
•  » » » » » 6 weeks ago, # ^ |   0 Sorry, my bad I thought subsequence needs to be contigous. Thanks for the help bro.
 » 6 weeks ago, # |   0 I don´t understand the problem B, why is {0,2,1} = 0?
•  » » 6 weeks ago, # ^ |   0 Because sorted array will be 0,1,2 and to it you need to swap 1 and 2. And of 1 & 2 is 0.
•  » » » 6 weeks ago, # ^ |   0 you are absolutely right, I was the one who made a mistake with the operator and I thought it was the minimum hahaha (((
•  » » 6 weeks ago, # ^ |   0 swaping 1 and 2 is sufficient ans = 1&2 = 0
 » 6 weeks ago, # |   0 Thanks for super fast editorial.
 » 6 weeks ago, # | ← Rev. 2 →   0 Good Round, I loved thinking about problem C, it was simple but tricky. going to remember it always. A great Round from an Indian problem setter.
 » 6 weeks ago, # |   0 for problem :ctest case : 5 1 1 2 3 3the given answer is 3,could some one please explain how it can be 3.i am getting answer as 2
•  » » 6 weeks ago, # ^ |   0 3 1 2 1 3 in this order...
•  » » » 6 weeks ago, # ^ |   0 in this case answer will be 2 lis=2 (12 or 13) rlis=2(12 or 13) minimum of them will be 2 again
•  » » » » 6 weeks ago, # ^ |   0 I think you got a misconception about subsequence. It doesn't have to be contiguous.
•  » » » » 6 weeks ago, # ^ |   0 sorry my mistake , i have considered only continues subsequence
•  » » 6 weeks ago, # ^ |   0 3 2 1 2 3
•  » » » 6 weeks ago, # ^ |   0 there is only one 2
•  » » 6 weeks ago, # ^ |   0 a = 1 3 2 3 1a' = 1 3 2 3 1
•  » » » 6 weeks ago, # ^ |   0 got it thank you i have considered only conitnueous subsequence
•  » » 6 weeks ago, # ^ |   0 Same I made so many WAs on this case lol
 » 6 weeks ago, # |   0 is there any method to solve A without dividing the string?
•  » » 6 weeks ago, # ^ | ← Rev. 2 →   0 It is possible to solve it by reading the string char by char.You are only interested in the length of the substring that contains the middle character (n//2) and repeats it for as long as possible to left and right.Here's a char-by-char submission:https://codeforces.com/contest/1682/submission/158090952
 » 6 weeks ago, # | ← Rev. 3 →   0 I have some doubt in problem C.For this test case 14150482826 299981842 846268930 299981842 16711396 299981842 160038184 87399809 36731648 410799926 150482826 16711396 410799926 355178268answer is 7, but my solution is outputting 6, may I know the problem here?(My approach is to build a sequence greedily by sorting the array and then taking minimum of them and then placing rest of the numbers on left and right of that minimum found (leftMost after sorting) (Counting them just), so that I get a strictly increasing sequence even if reverse, numbers that come twice are put in either of the sides.)Then I output the final answer as min(leftSum, rightSum) + 1I am counting these leftSum and rightSum in the above approach.
•  » » 6 weeks ago, # ^ |   +1 You are almost correct, but instead of always taking the minimum as the one being used by both the "leftSum" and the "rightSum", you can choose any of the number to be shared by both sequence. An example of this is "5 3 4 5 3" where both the left sequence and the right sequence used "4" in the LIS. Hope this helps :)
 » 6 weeks ago, # |   +4 Thanks for this wonderful round!I am finally a CM.
 » 6 weeks ago, # | ← Rev. 2 →   0 in problem B, with the input:1 80 1 2 7 4 5 3 6it seems like the answer is not correct, if im wrong, pls point out my mistakes.
•  » » 6 weeks ago, # ^ |   0 in problem statement it is clearly mentioned that value of X will always exist so this kind of test case not possible.
 » 6 weeks ago, # |   0 It's a little bit hard to ac the C for me,but C is a good problem!!!
 » 6 weeks ago, # |   0 Totally shit contest @coderanshu teri maa ki chute lawde
•  » » 6 weeks ago, # ^ |   0 tumhari maa ke paas lund hai kya bhai , bhagwan tumhari maa ka bhi chut de, I'll pray
 » 6 weeks ago, # |   0 It's Indian territory. love IIT CoderAnshu
 » 6 weeks ago, # |   0 In problem D:for input of: 1 4 1100my submission: [submission:https://codeforces.com/contest/1682/submission/158117585] gives output of: YES 3 4 1 3 2 4 but the accepted answer is: YES 2 3 3 4 4 1but I think my printed solution should also get accepted.. can someone please help me with this one. Thanks in Adv!!
•  » » 6 weeks ago, # ^ |   0 (1, 3) and (2, 4) intersect internally in the circle.
 » 6 weeks ago, # |   0 Please help meMy solution for problem E got RTE in test 8, but I don't know why; please tell me whyThank you!My submission: https://codeforces.com/contest/1682/submission/158149795
 » 5 weeks ago, # |   0 It's first time, that I got warning from codeforces, that my code of a problem of this round coincides with another solution of a person. I am surprised how could it be. I have checked both codes. Steps are similar. I am afraid will it going to block my account casually. For small problems steps can be similar by chance. What should I do now?
 » 5 weeks ago, # |   0 I never imagined, that i will be writing my very first comment on codeforces on this problem. I just some minutes ago, seen the message from system of codeforces. The message is that my code for problem 'A' and problem 'B' is matching with another person's code. I just shocked because I have written that code 100% with my intellect only. Even both problems are having WA multiple times, then it got accepted, because i was trying to decode the solution and even my rating has gone negative after this contest. I don't know that person, to which you are saying my code is matching. I have checked his code also by reference you send in message. I found that some variable name is matching in problem 'A' and very few things are matching in problem 'B'. First of all those both the problems are having very very short lines of code. Approx. 10,000 coders solved that problem, And you are fully confident that, if my variable names got matched or some other things(don't know how you checked) matched, then you with full confidence, just sent me message with declaration that i cheated and my rating changes reverted(even i loosed rating in this contest) And saying that I have to prove, what proves I should present here. I even not visited website ideone.com. I did it in my own offline compiler. What should i Do? Attention!Your solution 158032468 for the problem 1682A significantly coincides with solutions jaydevbambhaniya1/158013400, MANISH_SAHU/158032468. Your solution 158046434 for the problem 1682B significantly coincides with solutions MANISH_SAHU/158046434, jaydevbambhaniya1/158068875