You are not logged in. Please login at www.codechef.com to post your questions!

×

Regarding DEC18 Chef and Meatballs

8
1

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).

Am I wrong or the example has problems ?

asked 08 Dec '18, 07:50

thang040602's gravatar image

4★thang040602
8515
accept rate: 0%


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:

  • least meaty
  • 4th-most meaty
  • 3rd-most meaty <<<<
  • 2nd-most meaty <<<<
  • Meatiest
link

answered 09 Dec '18, 20:44

joffan's gravatar image

5★joffan
9488
accept rate: 13%

edited 10 Dec '18, 02:10

@admin I'm not sure how notification works so I'm pinging you in a comment also to correct/clarify this question

(09 Dec '18, 22:44) joffan5★

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.

link

answered 09 Dec '18, 17:33

sauravchirania's gravatar image

4★sauravchirania
482
accept rate: 33%

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.

link

answered 19 Dec '18, 00:37

weng's gravatar image

5★weng
412
accept rate: 0%

I had asked this exact doubt in the comment section of the question but the author did not reply unfortunately.

link

answered 18 Dec '18, 12:03

vagueman's gravatar image

4★vagueman
1
accept rate: 0%

basically, the question was worded wrongly and you had to understand and consider the testcase and ignore the wording.

(18 Dec '18, 12:05) vagueman4★

well the language was definitely not clear at all from the question please @admin take this into account.

link

answered 17 Dec '18, 16:25

srj1234's gravatar image

4★srj1234
1
accept rate: 0%

what output will i get if i repeat the number of meatballs? ex. [1,2,4,4,4]

link

answered 16 Dec '18, 11:53

shivam_145's gravatar image

3★shivam_145
1
accept rate: 0%

It's clearly mentioned in the question that all numbers have to be distinct. Hence your question is invalid.

(16 Dec '18, 19:20) avi2244★

If it was 3rd and 4th, would it be even solvable?

link

answered 16 Dec '18, 01:46

yigoli's gravatar image

3★yigoli
1
accept rate: 0%

Just keep in mind that the grader will give 2nd and 3rd meatiest meatballs. I have done this way and I am getting correct answer.

Try this way!

Good luck !

link

answered 15 Dec '18, 18:52

saurabhshadow's gravatar image

3★saurabhshadow
374
accept rate: 0%

edited 15 Dec '18, 18:53

@catchup Same problem I'm facing

link

answered 13 Dec '18, 14:46

gigawhiz's gravatar image

3★gigawhiz
-1
accept rate: 0%

@thang040602 can u please explain the question if u understood

link

answered 13 Dec '18, 10:53

andyy143's gravatar image

3★andyy143
1
accept rate: 0%

Let the meat balls arranged as : [5,8,1,2,9,10]

Examples:

? 1 2 3 4 5 :: Grader -> 1,2

? 1 2 6 4 5 :: Grdader -> 2,5

link

answered 12 Dec '18, 18:25

bibhu_107's gravatar image

3★bibhu_107
1
accept rate: 0%

Think of it like, the grader will sort the number in increasing order and then return the 3rd and 4th meatiest meatball number.....

link

answered 09 Dec '18, 22:54

root00198's gravatar image

3★root00198
316
accept rate: 0%

@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.

link

answered 09 Dec '18, 21:23

sauravchirania's gravatar image

4★sauravchirania
482
accept rate: 33%

@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]

Grader:2 3

link

answered 09 Dec '18, 18:47

fakeid_v15's gravatar image

2★fakeid_v15
2
accept rate: 0%

@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

link

answered 08 Dec '18, 19:32

aaryamann's gravatar image

2★aaryamann
111
accept rate: 0%

I too have the same doubt.

(08 Dec '18, 19:51) avi2244★

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.

1<2<3<4<5

link

answered 08 Dec '18, 18:45

priyanshul's gravatar image

3★priyanshul
0
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×25

question asked: 08 Dec '18, 07:50

question was seen: 4,414 times

last updated: 19 Dec '18, 00:51