Suggestions about solving this problem

Revision en3, by rachmaninoff, 2015-10-08 14:51:02

Hi! Could you please give me some hints on solving this problem?

Simplified statement:

You need to launch a rocket into space by detonating explosives attached to it. You can only detonate one explosive at a time and each one will carry the rocket for a distance given in the input. However, before reaching the maximum height and after launching the rocket, you may encounter some endangered bird species at different heights. You need to avoid hurting those birds by not detonating an explosive at the height they live.

Input: N — number of explosives N Integers representing how far can an explosive carry the rocket N — 1 integers representing the heights at which the birds reside

Find a configuration of detonating the explosives (that is output the order in which to detonate them — index starting from zero) such that no birds get killed.

Example : 3 2 4 6 4 8

answer: either 0 1 2 or 2 1 0

Tags algorithm, problem

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English rachmaninoff 2015-10-08 14:51:02 14
en2 English rachmaninoff 2015-10-08 14:50:29 19
en1 English rachmaninoff 2015-10-08 14:49:46 978 Initial revision (published)