I am quite confused about DEC18 Chef and Meatballs because since the explanation of the example test states that ‘The meatballs are sorted in ascending order of meatiness’ (I suppose that it means 1 < 2 < 3 < 4 < 5 < 6) the first query (1, 2, 3, 4, 5) returns (3, 4) which are the 2-nd and 3-rd meatiest balls, while I expect it returns (2, 3).
Since this is an ongoing contest, I would not say much.
Firstly, the example is absolutely correct.
The query returns the 3rd and 4th meatiest meat balls out of the five inputted. In the example test case, it returns 3 and 4 as they are the third and fourth meatiest respectively.
@priyanshul
If we’re given 5 meatballs with 5 being the meatiest and 1 the least, 5 would be the first meatiest one, 4 the second, 3 the third and 2 the fourth meatiest meatball. Shouldn’t the output then be 3 2 instead of 3 4
The example is correct. To clarify a bit, when the grader is given an input of 5 numbers, it arranges the numbers in increasing order of their meatiness and then returns the 3rd and the 4th number from the arranged order.
@sauravchirania For example: We have meatballs numbered as [1,2,3,4,5] and considering the amount of meat they contain [9,10,13,8,14] respectively then 5th ball is the meatiest, 3rd ball is the 2nd meatiest, 2nd ball is the 3rd meatiest, 1st ball is the 4th meatiest as per the question (correct me if I am wrong).
Grader:2 1
And according to you- [4,1,2,3,5] and their meatiness [8,9,10,13,14]
Good question. The language used in that problem is confusing, and unfortunately you need to work out the meaning from the example, which I think you have done correctly. In normal English descriptions, the two index numbers returned are for the third and second meatiest meatballs. They are wrongly described as the third and fourth meatiest because they are the third and fourth entries in an ascending sorted list of the meatballs.
@admin this needs correcting/clarifying in the problem.
Further explanation:
Given a test sample of meatballs, the feedback given is the 3rd and 4th entries in the following list sorted in ascending order of meatiness:
@fakeid_v15 in the example you have given, the grader will return 2 3.
I agree that the problem statement is a bit ambiguous but if you look at the sample test case given in the problem and the explanation I have given in my previous comment, you should be able to understand it.
PS: I am not sure how to reply to a comment so I had to add this as a separate comment.
Codechef exhibits again the lowest possible efforts in terms of checking their problems.
Problems wrongly stated, test cases that do not match the specified formats, incomplete test cases, plainly wrong specifications.
Litterally every contest is now plagued by the lack of serious of this platform. How many great problems and efforts can be ruined by the incapacity of this website to recognize their faults and to take the steps to improve their processes ?
Give people laddus to spot errors if you’re too lazy to make the most basic checks.
I’m sorry about my tone, but litterally every contest for the last few months have had a huge problem that would be easy to avoid with a little professionalism.