I was looking into other user’s solution and then I found this solution
this solution gives
1 2 3 5 4 6
but the correct answer is no then how did this solution get AC or I am missing something?
1 2 3 5 4 6
No,you are right,it’s because of weak test cases!!
what!!! . maan , this test case is so basic .
didn’t expect this type of carelessness from codechef
Many of the contest problems on codechef have very weak testcases. This happened with me in the previous contest - Cookoff April 20. For the 3rd problem - MINOPS, I submitted 2 solutions that give different answers for a testcase. Yet both of those solutions were accepted!
April 26, 2020, 8:01am
Thanks for reporting. We’ll look into it and add the testcase to the Practice contest.
what is the use?
same thing happened for POSITIVE MEX problem as well
if test cases are good only in practice section and not in contests…
then better there are only practice problems
I saw a submission for the TRIQRY which was simple brute force and was accepted. But when I tried to submit the same code ,I got TLE.
Were the test case changed during the contest??
Test cases never change during a contest. And secondly, how can you see someone else’s answer in the middle of the contest. Please enlighten all of us here.
I saw the submission after the contest ended.
Ohh, then thats okay. I misinterpreted what you said. Sorry.
If anyone can see my solution please suggest me if it went wrong in any test case
CodeChef: Practical coding for everyone
@anon38910692, bro your logic is correct but its worst case time complexity is O(n^2) for the cases like 5,4,3,2,1 and k = 1. so it should get rejected by TLE
@admin , please add this test case too.
Thanks bro! I had a doubt that why it was accepted n^2 complexity though I am happy my logic was correct.
can you share the test case please??
Please check out this post. Here i’ve explained in detail the difference between the solutions and the particular testcase that gets different answers from the two different solutions.
Hi. In the 3rd problem of April Cookoff, i.e. Simple Operations (MINOPS), I’m getting an AC verdict even though I know for sure that my code is incorrect.
Here’s the AC Code :
For the sample testcase,
The number of islands = 2
The gaps are as follows = [1, 3]
(here i’ve included 1 as my code calculates the gap from the starting as well. So the substring,
‘a’ at index 0 is counted as a gap, although its before any island. …