Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Ali has N friends standing in a line from 1 to N. He decides to take M photos for them. Each photo shows a contiguous

Ali has N friends standing in a line from 1 to N. He decides to take M photos for them. Each photo shows a contiguous range of friends where 3000 oto i shows friends from li to ri inclusive.

After taking the photos, Ali realizes that in each one of the M photos he has exactly one friend wearing a golden hat.

Ali was aware that some of his friends might have golden hats but he had never counted them and does not know which friends have those hats

Based on the photos ranges and the fact that each photo has exactly one friend with a golden hat, determine the maximum number of Ali friends that have golden hats or report -1 if it is impossible to find su an assignment.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 15th International Conference Dexa 2004 Zaragoza Spain August 30 September 3 2004 Proceedings Lncs 3180

Authors: Fernando Galindo ,Makoto Takizawa ,Roland Traunmuller

2004th Edition

3540229361, 978-3540229360

More Books

Students also viewed these Databases questions

Question

Compute the derivative of f(x)cos(-4/5x)

Answered: 1 week ago

Question

Discuss the process involved in selection.

Answered: 1 week ago

Question

Differentiate tan(7x+9x-2.5)

Answered: 1 week ago

Question

Explain the sources of recruitment.

Answered: 1 week ago

Question

Differentiate sin(5x+2)

Answered: 1 week ago