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

×

Problem in Chef and feast DECEMBER 18

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

bk54's gravatar image

3★bk54
93
accept rate: 0%


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.

link

answered 18 Dec '18, 01:25

sumit001's gravatar image

4★sumit001
261
accept rate: 50%

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:

×398
×2

question asked: 17 Dec '18, 23:44

question was seen: 180 times

last updated: 18 Dec '18, 01:25