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

×

One dimensional kingdom

I've a doubt with a testcase [1 5][7 8][0 10] , i think that on destroying [0 10] ,then [1 5] and [7 8] gets automatically destroyed ,so ,only one bomb is required. am i right?

asked 08 Jan '15, 22:58

ambika93's gravatar image

2★ambika93
8128
accept rate: 0%

edited 08 Jan '15, 23:27


if u put a bomb on x=6 then only [0,10] kingdom can be destroyed. consider this statement

A kingdom of the form [L, R] can be destroyed completely by placing a bomb at a point x on the real line if L ≤ x ≤ R.

link

answered 08 Jan '15, 23:07

raja44ever's gravatar image

2★raja44ever
126128
accept rate: 15%

@raja44ever, will the answer for that is 2 or 1?

(08 Jan '15, 23:17) ambika932★

2 bombs. For example, one bomb at x=1 and another at x=7.

(08 Jan '15, 23:50) mogers5★

Give me some important test case it is not passing last test case of the first task

(09 Jan '15, 01:58) ambika932★
1

You cannot ask for hints during the contest!

(09 Jan '15, 03:28) betlista ♦♦3★

what about the case when kingdoms are overlapping ?? like [0,1][1,2] from my understanding only 1 bomb is required. is it so ?

(09 Jan '15, 08:28) grvana1★

yes 1 bomb is required.... you have to put a bomb in the range of any kingdom to destroy it whether there is overlapping or not....just put bomb efficiently so that minimum no of bombs is required

(09 Jan '15, 15:34) raja44ever2★
showing 5 of 6 show all
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:

×288

question asked: 08 Jan '15, 22:58

question was seen: 2,621 times

last updated: 09 Jan '15, 15:34