×

# Problem in Chef and feast DECEMBER 18

 0 After asking the same question in comments section of the same problem and not getting any reply I am asking here.So,in seventh query of 1st eg. i.e. 3 0,since the value of c in this case is one so the person can only see colors in the range [0,2].So max. contiguous sub-sequence will contain only one dish with deliciousness 2.hence answer should be 2 ,but 3 is shown. Please clarify. asked 17 Dec '18, 23:44 3★bk54 9●3 accept rate: 0%

 1 The continuous subsequence can contain dishes with color other than [c−K,c+K] but since they won't be visible their deliciousness will not be added to the answer. 3c : Consider a person with colorblindness c. This person must choose an arbitrary contiguous subsequence of dishes on the table (possibly empty) and then eat all the dishes which this person can see. Chef wants to know the maximum possible total (summed up) deliciousness of the eaten dishes. The 7th query of example 1 has c = 1 and range as [0,2], if the whole sequence is selected as contiguous subsequence, it has 2 dishes with color in [0,2], hence they will contribute to the answer of the query as 2 + 1 = 3. answered 18 Dec '18, 01:25 4★sumit001 26●1 accept rate: 50%
 toggle preview community wiki:
Preview

By Email:

Markdown Basics

• *italic* or _italic_
• **bold** or __bold__
• 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:

×398
×2

question asked: 17 Dec '18, 23:44

question was seen: 180 times

last updated: 18 Dec '18, 01:25