Um_nik's blog

By Um_nik, history, 17 months ago,

We invite you to participate in CodeChef’s December Lunchtime, this Saturday, 26th December, from 9:30 pm to 12:30 am IST.
Note the unusual time. It starts at 9:30pm instead of the usual 7:30pm

You will be given a total of 8 problems (6 in Div2, 6 in Div1) to solve in a duration of 3 hours.

Joining us on the problem setting panel are:

Problem Submission: If you have original problem ideas, and you’re interested in them being used in CodeChef's contests, you can share them here.

Prizes: Top 10 Indian and top 10 Global school students from ranklist will receive certificates and CodeChef laddus, with which they can claim cool CodeChef goodies. Know more here.

The video editorials of the problems will be available on our YouTube Channel as soon as the contest ends. Subscribe to get notifications about our new editorials.

Good luck and have fun!

As this is my first contest as CodeChef admin, I wanted to add few words from myself. Please do consider setting problems on CodeChef, we need your help to create great contests! One of the advantages of setting problems on CodeChef is that you don't have to create whole problemset by yourself (though it is certainly possible, you can write directly to admins to contest.admin2@codechef.com for LunchTimes and to contest.admin3@codechef.com for Cook-Offs). Many new authors can't create whole problemset without experience, and that's totally understandable! Sending problems for review allows you to get feedback for our admins (Um_nik, 300iq, jtnydv25, Ashishgup and Morphy), and if your problem is good, you will get the invaluable experience of setting a problem for thousands of participants worldwide while working side-by-side with some of the best minds in competitive programming. Some of the best problems in this contest are set by first-time problemsetters, at least on such a level, and they did a great job, I'm looking forward to working with them again.

Apologies to SeismicToss for messing up the announcement :)

The contest is unrated due to queue and server issues.

• +350

 » 17 months ago, # |   +249 Should we start considering CodeChef as a regular place to compete xd?
•  » » 17 months ago, # ^ |   +74 By problems you can, servers you need to risk it.
•  » » » 17 months ago, # ^ |   +37 Since revamping our judging infrastructure 8 months back, we have had virtually no issues with submission scalability, and can easily process more than 2000 submissions and IDE runs per minute. The issue with the last Cook-Off was that we were caught off-guard by the sudden increase in traffic, and it took time for the extra servers to be deployed. That is not a valid excuse though, and we apologize for the inconvenience. We'll make sure to have sufficient redundancies in the future :)
•  » » » » 17 months ago, # ^ |   +106 Server down well this certainly aged well :\
•  » » » » » 17 months ago, # ^ | ← Rev. 2 →   +25 There Servers Are Not Working. Because, money is invested somewhere else, if you know, you know :PAlso, similar thing was happens in last contest there was some bugs, i seriously feels so bad for problem setters and things like this happens :(
•  » » » » 17 months ago, # ^ |   +41 "We'll make sure to have sufficient redundancies in the future." Yup, you totally did that.
•  » » » » 17 months ago, # ^ |   +21 cLoUD SerVeR Go BrRrRRRrrrRrr ...
•  » » » » 17 months ago, # ^ |   +29 We'll make sure to have sufficient redundancies in the future This aged poorly
•  » » » » 17 months ago, # ^ |   +36 ;)
•  » » » » 17 months ago, # ^ |   +28 Oof
•  » » » » 17 months ago, # ^ |   +17 Ouch.
•  » » » » 17 months ago, # ^ |   -23 I think you should stop trying at this point, we will give contests on CodeForces and AtCoder. You may continue on your conquest to monetize competitive programming on Unacademy and host Conversations with CodeChef on YouTube and while you're at it maybe start making video on Roadmaps as well like other “tech youtubers”. I understand there's no money in hosting competitions so it makes sense for a "For Profit" like you to not do it properly and place your resources on these. Also plagiarism issue isn't there on CF and AtCoder, you please continue on your path of becoming a “For Profit” with your “Parent” company Un-ethical-demy.
•  » » » » » 17 months ago, # ^ |   +31 You are being way too much harsh for just one contest , They had did many awesome works in the past , You should not forget them . BTW, I too don't like what Unacademy is Doing(Paid) , But Still they have done so many awesome things in past and are still doing it , You should take them into consideration before writing such a huge comment
•  » » » » » » 17 months ago, # ^ | ← Rev. 2 →   -12 Well yeah sure I am being harsh, but that was because of this and many other tons of posts like these. Check this out. This was in June, and when I didn't saw any changes I felt like it needed to be said.
•  » » » » 17 months ago, # ^ |   -23 This is super disappointing. We became too confident about our judging capacity and so had way more test files than we usually do. Coupled with the large participation, we hit the limit which hasn't happened in the last 8 months. We are very sorry for the bad experience. We will be increasing our capacity in a couple of days.
•  » » » » » 17 months ago, # ^ | ← Rev. 2 →   -17 kitna chutiya banaoge translation : How much fool you will make us ?
•  » » » » » » 17 months ago, # ^ |   0 Bro, please don't use such words in a platform like this, if you don't like it just don't give those contests and move on, no need to harass people who make time from their busy schedules and make a contest for us. I too feel there's something off in codechef and would prefer codeforces anytime but I do respect both of them.
•  » » » » » 17 months ago, # ^ |   +27 Last few short contests were really interesting in codechef which was the reason for high participation in this lunchtime. But again said that, we would see decrease in participant in upcoming short contests on codechef because of today's issue. I think upsolving contests would be useful than waiting for judgement for more than 45mins.
•  » » » » » 17 months ago, # ^ |   +3 CodeChef_admin Seems like site is now up, Is there any possibility we can expect queue to decrease in next few mins? Else I think participants like me would upsolve problems later on. I am very much curious in checking my solutions for Even Sequence.
•  » » » » » » 17 months ago, # ^ |   +17 Not in the next few minutes, no. By current rate, the queue will decrease somewhere close to the end of the contest.
•  » » » » 17 months ago, # ^ |   +8 2020 came calling :)
•  » » » 17 months ago, # ^ | ← Rev. 2 →   +10 Time travel at its best :) Read my first comment at the top.
•  » » 17 months ago, # ^ |   +92 tourist won 7 out of last 8 short codechef contests.
•  » » 17 months ago, # ^ |   +178 Quality of problems has improved significantly recently, I enjoyed the last few contests, would recommend for participation :P
•  » » » 17 months ago, # ^ |   +2 Smh
•  » » » 17 months ago, # ^ |   +75 It would be really nice if we could also submit.
•  » » » » 17 months ago, # ^ |   +66 I agree
 » 17 months ago, # |   +18 the queue was long in the cookoff and the contest was lagging so if you could work on it then it would be great.
•  » » 17 months ago, # ^ |   0 Yes, sorry about that. Please see the comment above regarding this.
•  » » » 17 months ago, # ^ |   +20 Please make the website contest ready before holding the contests otherwise it seems to be frustrating. If users such as Ashishgup would write a blog on cookoff then it is obvious that there would be a heavy crowd in the contest.
 » 17 months ago, # |   +14 Reminder 1 — Contest starts in 1 hour, 45 minutes.
•  » » 17 months ago, # ^ |   -7 Reminder 2 — Starts in 30 minutes!
•  » » » 17 months ago, # ^ |   +172 Reminder 3- Judging 'may' start in 30 minutes
•  » » » » 17 months ago, # ^ | ← Rev. 2 →   +53 Queue kisi ko wafa ke Badle wafa nahin milti
 » 17 months ago, # |   +47 Queue :(
•  » » 17 months ago, # ^ |   +32 We are working on it. Please continue to solve other problems.
•  » » » 17 months ago, # ^ | ← Rev. 3 →   +5 round should be unrated . I got WA verdict after 20 minutes which i could have fixed early if there wasn't queue . Also website loading too slow.Also please tell if it's rated or not now instead of wasting 3 hrs and telling after that it's unrated .WHY PEOPLE DOWNVOTING THIS ?
•  » » » » 17 months ago, # ^ |   -63 There is no time penalty in Lunchtime, so you did not lose anything?
•  » » » » » 17 months ago, # ^ |   +19 But there is something known as contest rank and acc. to what I know one would be lower in rank (and eventually lower in rating) if he/she doesn't solves the problem faster
•  » » » » » 17 months ago, # ^ | ← Rev. 3 →   +13 Time taken to solve a problem is taken into account (Did CC lied to you about that ? ). I could have fixed that in 2 minutes but i fixed after 22 mins. So yes i lost 20 minutes which i didn't deserved.Please make this unrated to recognize your fault at least . And please fix CC before hosting any rated round . It's now habit of CC to waste other people time.In div1 solving A,B fast mattered a lot and this queue ruined it.
•  » » » » » 17 months ago, # ^ |   +99 I was wrong, the time of last submission is used as a tie-breaker. Sorry.
•  » » » » » » 17 months ago, # ^ | ← Rev. 2 →   -22 Not offending you but curious how you became admin without knowing codechef contest rules ?Also please make problems well balanced . First 2 submission 600 and 3rd only 35 . It should have been like 600,300,100 to be a well-balanced problem set.
•  » » » » » » » 17 months ago, # ^ |   +29 I'm not writing rules or configure the system to enforce these rules. My job is to choose problems and make sure they are well prepared.I know that IOI-style ignores time of submissions, so I assumed that it is the same here. I was wrong.
•  » » » » » » » » 17 months ago, # ^ |   -39 Sir, I admire you. But, We Know the fact that why So Many Grand masters are interested in CC, money! And, it is ok.Also, i agrees that Question's Quality is good now, but don't just promote them blindly !!
•  » » » » » » » » » 17 months ago, # ^ |   +51 What did I promote blindly?
•  » » » » » » » » » 17 months ago, # ^ |   0 I don't think the questions were unbalanced. The questions were interesting and the subtasks this time were also well thought. Overall if everything would've gone well, I think I would've liked the contest. It sucked to have the contest unrated and take 40 minutes to judge a submission tho.
•  » » » » » » 17 months ago, # ^ | ← Rev. 2 →   -43 Ok
•  » » » » » » » 17 months ago, # ^ |   +59 I don't think you can judge difficulty gradient by contest that was basically stopped after 1 hour.
•  » » » » » » » 17 months ago, # ^ |   +10 Submission count of 3rd and 4th problem is low due to long queue of submission in first two problems. Even i found 4th problem easier than 3rd one. But we can't judge on submission count
•  » » » » » » » » 17 months ago, # ^ |   0 how to solve 3rd question?
•  » » » » » » » » » 17 months ago, # ^ |   +4 I reduced the problem to find longest subsequence such that every segment of equal elements is of even length. And that is just simple dp.
 » 17 months ago, # |   +34 submitted b 20 minutes ago still in queue.
 » 17 months ago, # |   +24 Judge is too slow .
 » 17 months ago, # |   +25 CC Judge..Please stop keep running and take some rest.
 » 17 months ago, # |   +23 When you waited 15 mins for your submission and the website shows "unable to connect to codechef server" :(
•  » » 17 months ago, # ^ |   +8 sme bro showing unable to connect again and again
•  » » » 17 months ago, # ^ |   0 Imagine at the last minute, it shows "wrong answer". -___-
 » 17 months ago, # |   +8 And here goes the queue...
 » 17 months ago, # |   +8 its working very slow .
 » 17 months ago, # |   +3 My solution for SWAP10HG has been stuck for 40 min now T_T
•  » » 17 months ago, # ^ |   0 When I first submitted, it had like 100 submissions. Still showing server error.
 » 17 months ago, # |   +1 Please declare it unrated now. It (judge servers) has reached the heights of all frustrations now!
•  » » 17 months ago, # ^ |   +5 These people make ICPC round in India. Do they really deserve to host ICPC ?
 » 17 months ago, # |   +3 Anyone facing queues ?
•  » » 17 months ago, # ^ |   0 bro issues!! im not even able to submit the code
•  » » » 17 months ago, # ^ |   +40 bro issues? that's something new
 » 17 months ago, # |   +1 Unable to connect to the codechef servers and then you are allowed to make one submission in 120s
 » 17 months ago, # |   +35 cc is the internet explorer of the programming websites.
•  » » 17 months ago, # ^ |   +9 You are dis-respecting Internet explorer by comparing with cc
 » 17 months ago, # |   0 I have submitted my code 35 minutes ago,still not getting any results.
 » 17 months ago, # |   +32 I trying to submit a problem for 30 minutes. but codechef do not want to take the solution. xD
•  » » 17 months ago, # ^ |   +1 for sure they were not few moments!
 » 17 months ago, # |   +23 Ok now you can't deny the fact that it is getting frustrating now. Please make it unrated.
 » 17 months ago, # |   +10 The codechef server is not loading. I have been waiting for 25 minutes to submit my code
•  » » 17 months ago, # ^ |   0 well, I am able to submit but submission remains in the queue.
 » 17 months ago, # | ← Rev. 2 →   0 Site loading too slow.
 » 17 months ago, # |   +7 Make this shitty contest unrated! Unable to connect to codechef servers
 » 17 months ago, # |   +79 Everyone when 300iq didn't make many tests last Codechef:"Weak tests! Bad problems! So easy to cheese!"But actually, he was just trying to lessen the load on the queue. Truly a 300 iq move.
 » 17 months ago, # |   +8 Codechef is only focusing on their unacademy course.
 » 17 months ago, # |   +32 Auto comment: topic has been updated by Um_nik (previous revision, new revision, compare).
•  » » 17 months ago, # ^ |   +27 Thanks for making it unrated now (after half the time) otherwise its really disappointing if a contest is declared unrated at the last moment.
•  » » 17 months ago, # ^ |   0 Can you please also announce this on codechef contest page too? I don't think every participant is following this announcement on codeforces.
•  » » » 17 months ago, # ^ |   0 He has done that already
•  » » » » 17 months ago, # ^ |   0 I can see that now, It was not present at the time when I checked before posting above comment. Maybe lag in comments also :P
 » 17 months ago, # |   +7 codechef should do something because there are only two short contest in whole month and issue like this in those contest is very frustrating for all participants.
 » 17 months ago, # |   +6 That was not a good way to end the year.
•  » » 17 months ago, # ^ |   +21 Well it's 2020, what do you expect ??
•  » » » 17 months ago, # ^ |   +7 Every year is a 2020 in CodeChef.
 » 17 months ago, # |   0 I learned so much from solving problems on this website, But, Very Sorry to say this: i am happy you are investing so much in CP in India! but, pls try to run things smoothly, just a suggestion!! i saw lot of grand masters who used to hate CF are liking this, because of _ _ _ _ _... promotions mei itna paisa lagaya, kaash achha platofrm ke liye lagaate, No Hate ! <3
 » 17 months ago, # |   -21 codechef ki ma ki chut time waste kar diya behen ke lawdo
 » 17 months ago, # |   0 need a codeforces round ASAP to get over what codechef has just done to us.
 » 17 months ago, # |   -18 Codeforces smoothly handles over 15K participants every contest , to the contrary , cc can't handle even half the load...
•  » » 17 months ago, # ^ |   -6 I think it is probably because of cf has pretests
• »
»
»
17 months ago, # ^ |
+6

CF also has features like hacking phase, announcements for which we get notifications, we can ask our doubts/questions to the problem setters, leaderboard that updates in real time unlike every 1 minute or so and a leaderboard which accounts for people who have 0 correct submissions too. Also CodeForces is non-profit where I have seen only HarbourSpace sponsoring rounds and imho that is fine. CodeChef is blatantly supporting a scammy educational institute and yet still does not want to spend on their servers. They also offer certificates for money which cost a lot. You would think after all this, they would have better servers compared to CF.

inb4downvotedbyindianfanboys

•  » » » » » 17 months ago, # ^ |   0 Fair enough. I get your point. But CodeChef only has 2 rated contests to host per month and CodeForces has way more than that. Maybe I am wrong ahout Unacademy, I will check out their free stuff. My only point is, sure, they don't force you to buy their stuff but simply because they would be earning significantly more now that they are non profit, they can invest more. And maybe they did and yesterday was some fuck up, just like Google went down a few days back which has so many resources.
 » 17 months ago, # |   +26 Contest Authors just wasted their problems. It would've been nice if this contest was on cf. :'(
 » 17 months ago, # |   +6 What a way to end the year, CodeChef!
 » 17 months ago, # | ← Rev. 2 →   +3 [user:CodeChef_admin,2020-12-26]Does contestant got laddus in an Unrated contest in codechef? Anyone knows about that? CodeChef_admin
 » 17 months ago, # |   +73
•  » » 17 months ago, # ^ |   -9 That is just happening from last 2 contest not every contest, you should not make such huge comment on the basis of a few time error
 » 17 months ago, # |   +31 ahh, it was a cool problemset :'(. First atcoder doesn't allow to participate now this happens :/
•  » » 17 months ago, # ^ |   +8 same feelings
•  » » 17 months ago, # ^ |   0 XOR palindrome problem was cool?
•  » » » 17 months ago, # ^ |   +45 Is it not?
•  » » » » 17 months ago, # ^ |   0 (I didn't want to answer before I got AC and the contest ended)I didn't mean to say it is a bad problem, just not very interesting. To me most of the time it was just somewhat tedious DS bashing.
•  » » » » » 17 months ago, # ^ |   +8 I thought it is an awesome problem with two nice observations and pretty simple implementation with trie. Maybe we have different solutions.
•  » » » » » » 17 months ago, # ^ |   +10 Ok, there's a nicer solution. Then I won't complain. It is possible I overcomplicated — I had lazy propagation on a compressed segment tree (with custom operations).
 » 17 months ago, # |   -11 Codechef always forces us to permanently leave its platform in short contests.
 » 17 months ago, # |   -9 So horrible experience in the lunchtime now at codechef with servers connection . I am thinking to leave and not compete in the shitty website again . I left earlier for the poor problemset reason and i guess they have not improved in that too . I guess it's Goodbye Codechef already :)
 » 17 months ago, # |   +1 I really feel sad for problem setters , there were so nice problems , queue ruined their efforts
 » 17 months ago, # |   +2 you should give us more time and solve the server issue.Not making this contest unrated will solve the problem
 » 17 months ago, # |   0 I have 4 submissions queued now with the earliest one 30+ minutes ago. Hope this issue resolves soon! Nevertheless, the problems were interesting.
•  » » 17 months ago, # ^ |   0 yeah thats why i am saying admin should fix the server issue then resume the contest with extra time and make it rated
 » 17 months ago, # |   +2 only For Indian After submitting code
•  » » 17 months ago, # ^ | ← Rev. 2 →   0 questions were interesting..but some server issue make this end of year worse
 » 17 months ago, # |   0 I participated in December Cook — off and left the contest in between because I thought it will be unrated but it was rated. Now today, inspite of server problems, my contest went pretty good and achieved my first two digit rank and the contest is unrated :) .
 » 17 months ago, # |   0 Stop spreading hate so much for CC, Don't forget what they have done for CP in Past in India.
 » 17 months ago, # |   +13 Its very bad to see ppl cussing codechef, there can be problems like these and it happens in codeforces also (maybe less no. of time)... but I hope cc will show the reason officialy.I am saying this is bad bcz, at first someone pay the authors to create contest for u to participate in and if something wrong happens than its totally their mistake... maybe they had judged it all wrong like no. of ppl and no. of files. Actually as one of guy in comment was saying above, it more of seems very interesting case of how ur servers can get overwhelmed with these type pf things which no one can think of.
 » 17 months ago, # |   0 Is CodeChef worth giving the contest?? I had my submission queued for 25 mins. XD
•  » » 17 months ago, # ^ |   +6 Yes, I strongly feel so. U need to experience a variety of problems. There is some pattern of problems and so the diff. b/w cc and cf. If u want to do it right way then I think u should practice problems from 2-4 diff platforms (while giving time to good problems not just solving easy everywhere).
•  » » » 17 months ago, # ^ | ← Rev. 2 →   +3 I totally agree with kesh4281 usually I have noticed nature of problems in codeforces and codechef are slightly different which really helps in learning.
 » 17 months ago, # |   -7 How to solve even sequences ?
 » 17 months ago, # | ← Rev. 2 →   -9 .
•  » » 17 months ago, # ^ |   0 And why so?
 » 17 months ago, # |   +9 Even though contest is unrated, do try Sum of Digits — https://www.codechef.com/LTIME91A/problems/SUMDIGIT. It has been made with a lot of work.
 » 17 months ago, # |   +9 Offcourse, we want codechef not queuechef
 » 17 months ago, # |   +1 Will we get verdict this year or in 2021?
 » 17 months ago, # |   0 'Horoscope Matrix' is a segment tree problem? 1:0;
•  » » 17 months ago, # ^ |   0 I was able to do it without using it.
 » 17 months ago, # |   +32 Me after getting WA after 52 minutes in queue-
 » 17 months ago, # | ← Rev. 2 →   0 how to solve even sequence problem??? any hint.. problems were really awsm....
•  » » 17 months ago, # ^ |   0 Try using DP with 2 transitions, first transition is getting 2 equal number, and the second transition is delete the current number (delete a number and insert extra number to get a pair has tha same cost) .
 » 17 months ago, # |   0 "An even sequence has the following property: each maximal contiguous subsequence which contains only equal integers (i.e. the same integer repeated a number of times) has an even length. In particular, the empty sequence is even. A subsequence is maximal if it is not contained in a larger contiguous subsequence which contains only equal integers."The example says seq "112" is not an even sequence. Why? The definition says it is.
•  » » 17 months ago, # ^ | ← Rev. 2 →   0 equal digit length should be even in this case length of digit 2 is not even -> "only equal integers (i.e. the same integer repeated a number of times) has an even length"
•  » » » 17 months ago, # ^ |   0 Each maximal contigous subsequence...The 2 is obviusly not maximal.
•  » » » » 17 months ago, # ^ |   +3 Yeah it is — it is not contained in any larger contiguous subsequence which contains only 2.
•  » » » » » 17 months ago, # ^ |   0 how to solve this problem??
•  » » » » » » 17 months ago, # ^ |   +4 Solution for Even Sequence: Dynamic Programming.Main intuition: Deleting elements is beneficial only when you are merging two disjoint subsequences whose elements are equal. To do so, it is beneficial to always pick the nearest such subsequence. Otherwise you can only add elements.First of all, condense all maximal contiguous subsequences. Then maintain answers for $dp[id][parity]$ which is equal to "the minimum cost such that i have processed till index id and all maximal contiguous subsequences are even except the last one, the last one has parity equal to the parity in the state".For transitions: You can either choose the immediately maximal contiguous subsequence OR you can choose the nearest previous contiguous subsequence whose elements were equal to the elements of the current contiguous subsequence. (You will have to use some optimizations like prefix sum for full score, also you will have to keep track of the last occurance of each subsequence)The answer is obviously — $dp[number of subsequences][0]$
 » 17 months ago, # |   0 Can anyone explain why is the answer for THREE (Three Letters) equal to $\displaystyle \text{min}\Big( \sum_{c \in A} \Big \lfloor \frac{f_c}{2} \Big \rfloor, \frac{|S|}{3}\Big)$ ?
•  » » 17 months ago, # ^ |   +8 you can create a palindrome using only two ways.1st three same characters and 2nd 2 same characters and one different. So maximum number of palindrome of size 3 we can create is ∑c∈A⌊fc2⌋. Also it can't exceed size of string/3 so take minimum.
•  » » » 17 months ago, # ^ |   0 Thank you for replying.I understand that these two things give two different upper-bounds on the answer, but can you prove why is the answer exactly the minimum of those? (i.e. why can't the answer be any other value that is lesser than those two things?)
•  » » » » 17 months ago, # ^ |   0 Can any of the admins comment on that, please? I am still unclear of the proof of the formula. Um_nik, Ashishgup
•  » » » » 17 months ago, # ^ | ← Rev. 3 →   +3 Assume, you have an array of length n and there are x (x <= floor(n/3)) pair of numbers such that both of them are equal, you'll always have x numbers to insert between them to make them 3-length palindrome. Example 1:n = 5, floor(n/3) = 1, so we can't have more than 1 such palindrome.{1,1,2,3,5}: You can always replace X in 1X1 by 2,3 or 5 to make it a 3-length palindrome. Example 2:n = 6, floor(n/3) = 2, so we can't have more than 2 such palindromes.{1,1,2,2,3,4}: You can always replace X in 1X1 and Y in 2Y2 by 3 or 4.So basically, you can never run out of the number of elements to insert between such pairs if x <= floor(n/3).
•  » » » » » 17 months ago, # ^ |   0 This makes total sense now. Thanks very much!