How you Doin'?
CodeChef NSUT Chapter is proud to invite you to C.O.D.E.R.S, which takes place on Monday, November 29 at 20:00(IST). The contest is rated for Div. 2 & Div. 3 participants.
Each division has six problems to solve in a duration of three hours. We have tried our best to keep the problem statements interesting yet short. And, YES! the theme of the contest is F.R.I.E.N.D.S, could it BE any more exciting?
Joining me on the organising panel are:
- Admin: Utkarsh Utkarsh.25dec Gupta
- Setters: Jayesh jayeshaw Shaw, Kanhaiya mr_practice001 Mohan
- Testers: Nishant nishant403 Shah, Divyansh tyagsa Tyagi, Akshit AkshitDh Dhoundiyal, Syed Ali mafailure Aatif
Good luck to all the participants!
UPDATE: Contest is postponed by one hour due to technical glitch.
UPDATE: Really sorry for the inconvenience. We did not intend this to happen. Due to various contests lined up in the coming days, we have decided to organise this contest on Monday, November 29. Coincidentally, it is my birthday too. :)
As a tester, I can confirm that the problems are pretty nice! I would recommend participating in this round and enjoying the problems.
I second that!!
Good luck everyone!
As a setter, I wish you
solve all problemsread all statements and watch a few episodes after the contest.Before the contest as well xD
As an indian i would have liked nothing more than picture of legend jethalal in place of friends but ok
CodeChef's domain name has been expired...
Working fine now!
Working now !!
Not working this side !
Working for me.
Check if your browser is caching the old page. If not, its probably provider level caching that hasn't been flushed since the issue was fixed.
Press ctrl + shift + delete and delete last 3 to 4 hours cache you will be able to access CodeChef.
I tried clearing cache, but still same issue. Hoping it will get resolved before the contest starts.
Maybe try using a different browser
still not working on safari
I have been using firefox, maybe try that, idk what to do if that also doesnt work
If it does not work for anyone, please hard refresh once, and it should work. Ctrl+Shift+R.
Still Not working :(
I have started downloading Firefox,let's see what happens
Not working on firefox as well for me
now working on chrome suddenly,check
Not working for me even after clearing all the cache from the browser
Hard refreshed, cleared cache.. Still not working!!
It seems that it's fine now for me!
Just me or are problems not loading?
they seem to have postponed it by an hour
Ah, this should probably be pinned somewhere lol.
Edit: I'm blind, it is pinned in the announcements section. They really should have better notifications like CF.
Edit 2: Apparently they do have proper notifications.
Codechef is known for this since ages
I still can't access the site lmao
Check the announcement
yhi tho khubsurati h codechef ki
Why are problems not loading?
Now where are the problems?????
Contest will start at 9:00 PM IST.
1hour delayed?
wait!! no one told that we need to question and answer by ourselves?? Edit: just now seen the announcement
see this...
Since the timer still shows 2 hours and some minutes remaining, are we to assume that the contest will start at 9PM IST and end at 11PM IST?
No, the duration would still be 3 hours. It would be 9PM — 12AM IST.
Auto comment: topic has been updated by mr_practice001 (previous revision, new revision, compare).
Hope it doesn't turns out that A few were able to see problem at 8:00 PM and are solving them now , ( as this has happened several times , earlier)
I can ensure, that did not happen.
Okkk , thanks for the info
Its happened once if I recall correctly? During the February Lunchtime this year. Unless you're counting the Div3 and Div1 problemsets being swapped for the first 5 mins of this year's June Lunchtime, I can't think of another occurrence.
I can recall 2 occurences , ( Don't remember when they happened ) , once even I was able to see the problems.
What happening in the round on the contest page time of contest is start but outside it shows that 1 hour is remaining to start the contest.
Please read the announcement.
Tomorrow, Overlapping with Codeforces round.
This is why i <3 codechef
I am facing this problem. How can I get rid of this problem?
"This domain name expired on 2021-11-24 09:12:07 Click here to renew it."
Clear the DNS cache so it re-fetches the current ips pointed to by the domain.
Try this and see if it works?
No. It's not working.
Try clearing your site cache as well maybe?
Chrome
Any other chromium based browser
Firefox
I tried all those things but it's not working for Chrome.
not working for Safari even after doing this
Try using mobile hotspot
Please try connecting with a different network provider once. If it works, you should be able to get back to the original provider and it should work. Also, please trying using Firefox instead of Chrome.
Ok. Thanks everyone . At last it's working.
Site opening when I use my mobile data but it`s not opening when I use WI-Fi..Why is it so?
Well.. Whatever, its just 1 more day :)
Yeah… But now it overlaps with a CF Div 3 :(
I know, that was sarcasm, and most of the people will probably give CF Div3 tomorrow, i think authors should consider rescheduling the contest.
And they have moved it, I see. All good!
1 day delay ??
Who will leave a codeforces contest for codechef XD
I prefer codeforces at least for div3 people. casue of plag issue in codechef (:
But i believe codechef will change their time :|
Now it is showing delayed by 4 days 22 hours...
Ah shit, here we go again
Contest delayed to tomorrow.
now it clashes with div3 :(
UPD: they decided to postpone it to Monday so no clash :)
you never know
Man i hate codechef!
are hota h kabhi kabhi
Vintage Codechef!
Downvoted the post !!
clashes with the div3 round now
In which imagination are you thinking that people will skip tomorrow's codeforces div-3 and give this contest?
Now there will be a clash between Codeforces Div 3 and this contest. mr_practice001, please reschedule the contest so that there is no clash with other contests.
I think most of the people would give the div 3 cf tomorrow, can you make the contest earlier so it ends before the div 3 round?
Update: it's rescheduled to 29th Nov 8 pm :)
Long live codechef
chill guys i think the contest will most probably postponed . as testers and setters will participate in div 3 round too. isn't it mr_practice001
Yes, updating in a minute.
If possible try to make it today itself.(although I too think this isn't gonna happen).
Brace for downvotes
And, YES! the theme of the contest is F.R.I.E.N.D.S, could it BE any more exciting? Ok :)
i would have prefered tmkoc as theme as setters are indians but whatever mr_practice001
Would keep that in mind next time. Jai Jinendra :)
Timer: 0s Refreshes Timer: 23hrs 59mins 58secs Div-3: "So you've chosen death"
UPD:- postponed to 29th
CC:- "Crisis Has Been Averted"
Kindly check the update.
From codechef: "We are postponing the contest to Monday, 29th November at 8pm. We sincerely apologize for the inconvenience caused."
I still doubt the date
Nsut-not sure about time
Bump
We are postponing the contest to Monday, 29th November at 8 pm. We sincerely apologize for the inconvenience caused.
Some users are still facing issues accessing the website due to DNS cache issues at the ISP level or the browser level which are beyond our control.
Auto comment: topic has been updated by mr_practice001 (previous revision, new revision, compare).
That's fine. It is clear that the internet issue is out of your control.
Reminder 2: Contest starts in ~30 minutes.
Also, the ranklist is ACM type but you would be able to see the result for each test file.
How to solve They Get Back Together? I spent a long time implementing an $$$O(T \cdot \sqrt{N} \cdot log(N))$$$ idea but couldn't get it to work in the end.
Clearly the median of the rectangle values is an optimal $$$x$$$.
I was using some complicated formulas to find the number of elements less than $$$x$$$ in a given row (since another binary search to check this would definitely be too slow) so that I can ternary search on the median by checking the number of elements less than a given $$$x$$$ in the rectangle.
But an diagonal $$$i$$$ always has smaller elements than any diagonal $$$j \gt i$$$. So we can just walk over the diagonals and add the number of elements on it till we reach a diagonal that has the midpoint.
This works in $$$O(rows) = O(\sqrt{n})$$$ since:
$$$rows \lt columns$$$ is optimal for the divisor pair.
Diagonals except for $$$[1, rows]$$$ and $$$[columns - 1, rows + columns - 1]$$$ have same length, so can check if it lies there or step to it in $$$O(1)$$$ time preventing it from becoming $$$O(columns)$$$.
So we can trivially find the median. Additionally every diagonal is a sum of natural numbers $$$[l, r]$$$ so the sum can be trivially calculated in $$$O(1)$$$ time per diagonal as well.
So the solution can be trivially implemented in $$$O(T \cdot \sqrt{n})$$$
Also a few of the earlier problems had some ambiguity and / or really weak samples:
All the Candy — I spent 30 mins thinking I could rotate the array, not permute it, and this passes samples as well.
Ross Wedding — Flipping on $$$s_i = 1$$$ instead of $$$0$$$ passes samples.
Similar to you I also wasted 20-30 mins in All the Candy problem thinking why rotating the array can't get proper answer (as well as got 1 WA so overall wasted 30-40 mins on simple problem) to realize that all possible ways means to permute as well :/
And due to this my rank fall down by almost 20-30 (due to which I may miss 5 star)
Other than that can you tell me how to solve "One where Joey dates Rachel" I thought of 4 state dp where 1st and 2nd state are index of string S,T and 3rd state 0,1 (for inserting at start) and 4th state 0,1 (for inserting at end) But didn't had time to try it.
Edit: missed by 3 rating points :(, if Codechef removed some cheaters I would have become 5 star
We can get the minimum answer by either:
Performing flips on $$$s$$$ to match it against some substring of $$$t$$$ and then appending the remaining characters.
Adding a single character to the start / end of $$$s$$$, using that to flip $$$s_1$$$ or $$$s_n$$$ respectively, performing the remaining flips to match it to some substring of $$$t$$$ and then appending the remaining characters.
So we only have to try $$$4$$$ or $$$9$$$ strings (depending on implementation) against the substrings of $$$t$$$.
Its a bit difficult to explain why this works, but the key part is that:
If we are trying to make a string match by flipping its optimal to fix all in $$$[1, i - 1]$$$ before $$$i$$$ since we'll otherwise have to move back across $$$i$$$ to fix it, undoing our fixing of the position.
So by appending vals at the start / end of $$$s$$$, we can only perform flips that affect the flipped state of $$$s_1$$$ or $$$s_n$$$ of the original string. So we only need to check with those $$$2$$$ positions flipped.
Submission
There is one solution using DP : dp[i][j][k][l] , i<=n, j<=m, k<=2, l<=2. i,j denotes first i characters of s and first j characters of t respectively, k denotes whether the ith character is flipped or not, and l denotes whether I can append character at the end or not.
Now, if s[i] == t[j], then we can skip these two characters and check first i-1,j-1 char (In this case, k must be equal to 0 as we are not changing (i-1)th char and l must be equal to 0 because we cannot insert char in the middle now).
If they are not equal then we can use the flip operation, but if I have only one char left in string s then we can insert char in the beginning and flip the two characters.
One more condition: If l == 1, then there is a possibility that we can append t[j] to s or we can append reverse char of t[j] and then flip.
Minimizing all these will give the minimum required answer.
My code : https://www.codechef.com/viewsolution/54543364
I missed it by 1 rating. I stand on 1999 :)
Do you have any link for your T√N approach ? I was able to get AC in T√N Log(N) approach .
I can't understand the part where you are calculating the sum of each diagonal in O(1) , In worst case there can be N diagonal , so shouldn't it be O(T*N).
How is the answer for "The One with All the Candy"(Div 2-B) for the following case 2 ?
1
4
0 1 0 1
The people at position 2 or 4 can start and pass that will take 1 second and then the game will be over. How is the answer for this case 2 ?
Because it is allowed to rearrange the neighbours. I also missed this :(
Where the fuck did they mention this? Why is there so much ambiguity in the problem statements ?
Couldn't the setters have written this explicitly that it is allowed to rearrange the neighbours ? They didn't mention it clearly and there is no such case in the samples either where permuting the array will give a different result.
This ruined the contest for me. I ran thousands of stress tests and wasted so much time on this :( .
mr_practice001, jayeshaw, this contest is crappy as compared to the other recent codechef contests.
All what was about rearranging was in the explanation of sample tc 2, I mean wtf they didn't mention it anywhere in the question itself, wasted 1.5hrs with 5WA
Is it normal to expect participants to rely on sample cases' explanations for picking up crucial missing information in the problem (that reordering is possible)? Moreover, this was a rated contest! This is unfair. I also raised a problem statement clarification for this problem but got no reply. jayeshaw please look into this. If this was deliberately done, it was more of a April Fool's contest rather that a CP contest
Indeed this was an April Fool's contest.
I got -138 rating in this contest because of this issue. The lazy setters didn't even reply to your clarification request. This contest should be made unrated but that would be too much to expect from CodeChef.
mr_practice001 , can you please have a look ?
You can permute the order, not just rotate it.
So choose the ordering as $$$[3, 4, 1, 2]$$$, then the game will go 3 -> 4 and then stop.
They didn't mention it clearly and there is no such case in the samples either where permuting the array will give a different result.
Shitty contest.
Could you please tell me where its really mentioned that the neighbours can $$$\textbf{stand in any order}$$$ they want or something similar ?
I don't mean to be rude, but even after getting the extra time because of the postponement of the contest, such mistakes dont feel cool !
I agree it isn't clear at all, even I wasted 30 mins on that interpretation of the problem.
I guess its supposed to be "Among all possible ways in which the $$$N$$$ neighbors start the game".
But it really should have been something like "Among all possible orderings of the $$$N$$$ neighbors" or something similar like adding a note "You can reorder the neighbors however you want"
mr_practice001 I think the testcases of The One Where Joey Dates Rachel is weak. This AC solution is giving output as -1 for the testcase
The answer should be 2
Its definitely weak, my solution can perform incorrect flips when matching the first or last window but it gets AC.
Consider a case like
My solution will print $$$2$$$ instead of $$$4$$$ because it will add match $$$s$$$ against $$$t[1, 6]$$$ while logically flipping $$$s_1$$$ on its own even though a character can't be inserted before it.
Basically that
(!j && !k) || n < m
should be(!j || window_start > 0) && (!k || windowstart < m - n)
instead.How to solve
The One Where No One is Ready
NOTE: There may be a more cleaner and standard solution but I did it this way
We had to calculate the possible maximum size of pants for each character from 'A' to 'Z' individually.
But it had lot of corner cases like:
1) if no element of that character ans is 0 for that
2) if k==1 the only consecutive section must be either at start or at the end or both, In this case just try out all three conditions and whatever is possible take max of that
3) if only one section is available and k>=2 than ans is that section
Now other than these we have to try 4 types of construction for the pants
===> if(start and end have that character) then try to take both and take largest k-1 section excluding them
===> if(start have that character) then try to take that and k-1 largest section excluding start
===> if(end have that characters) then try to take that and k-1 largest section excluding that
===> take k-1 largest section (other than start and end)
the max of all these 4 constructions would be the answer for that character
Do similar for all other characters and print the max of all
Edit : As I said, there is indeed a cleaner solution explained below by ExplodingFreeze orz!! (Not tagging him)
There is indeed an easier to implement construction. I feel its probably a bit harder to observe though.
Note that a single operation can delete any substring $$$[l, r]$$$ of the string.
Suppose our answer is going to use character $$$x$$$. We want to keep some subarrays of $$$x$$$ and delete all the remaining regions.
If we take some contagious substring $$$[i, j]$$$ of $$$x$$$ we will have to delete $$$[1, i - 1]$$$ if $$$i \gt 1$$$ and $$$[j + 1, n]$$$ if $$$j \lt n$$$.
Now what if we want to take $$$[p, q]$$$ along with $$$[i, j]$$$? (assume $$$j \lt p$$$)
We already deleted $$$[1, i - 1]$$$ and $$$[j + 1, n]$$$ for the first subarray, we can now change the latter to $$$[j + 1, p - 1]$$$. Clearly this is non-empty since otherwise $$$[i, q]$$$ would have been a contiguous substring of $$$x$$$. Additionally, we will also have to delete $$$[q + 1, n]$$$ if $$$q \lt n$$$.
Basically we can notice any contiguous substring $$$[i, j]$$$ of $$$x$$$ has cost $$$(i > 1) + (j < n)$$$ if it is picked first, and $$$(i > 1) + (j < n) - 1$$$ otherwise, so we can just rewrite the total cost as $$$1 + \sum ((i > 1) + (j < n) - 1)$$$ over the subarrays we take. Since the individual cost is always $$$0$$$ or $$$1$$$ (except for the case of an entire array when its $$$-1$$$ and we only take a single subarray anyway), it is optimal to just greedily take them in sorted order of length if the cost after adding it doesn't exceed $$$k$$$.
Submission
CodeChef, be shameful please!
10 mins ago this contest ended in CodeChef. I don't know you will believe me or not, 6 peoples submitted exact same code (just template is different), but I know they will not get skipped.
But why? Why CodeChef don't skip same solution just as CodeForces do?
Yes I know comparing CodeChef with CodeForces is shit, you maybe 5* in CodeChef but in CodeForces, maybe be you are newbie, yes that's the level of CodeChef & a 5* Coder in CodeChef, LOL, we all know that, even recruiters also do. Even the people who do cheating they have no future, no interest for ICPC or IOI, they are the worst people in our community & may GOD punish them for it.
But the thing is, why CodeChef don't skip same solution? Why they are not worried about their reputation & give MOTHER FUC*ING cheaters chance to do cheating? Any reason? Any CodeChef admin/moderator here who can clear that?
Such a shitty contest!
Didn't expect such type of problems from NSUT!
weak test cases
what should be the answer for N = 1 case for problem https://www.codechef.com/problems/S07E09 ?
my code is getting accepted no matter what you print
https://www.codechef.com/viewsolution/54541718
https://www.codechef.com/viewsolution/54540214
https://www.codechef.com/viewsolution/54546806
I think the case of N=1, shouldn't even be there cause if you have say a[0]=5, so you can't really pass the bowl and cannot even drop it, thus holding it infinitely. The only corner case acceptable should have been for N=1 and a[0]=0, and the answer to which would have being 0!
yeah that makes sense.But if i am not wrong this case should have been explained in the question itself or maybe included in the sample test cases.Wasted a lot of time thinking what to do for N=1