1201 - Select Your Ropes

Discussion around the problems of the COJ.
Forum rules
Remember that posting AC code is not allowed here. If you are going to ask a question or to post a solution, describe your algorithm instead. Posting AC code will be penalized.
Post Reply
User avatar
dovier
Posts: 1143
Joined: 8 years ago
Location: Havana, Cuba
Gender: Male
Cuba

1201 - Select Your Ropes

Post by dovier » 8 years ago




User avatar
Phantom
Posts: 58
Joined: 8 years ago
Location: Cuba
Gender: None specified

Re: 1201 - Select Your Ropes

Post by Phantom » 8 years ago

Please... Some body can explain me this exercise??... Because I cannot understand it very well yet... I suppose...
I thought the output in this exercise must be:
3
20

I have got only Wrong Answers in this foolish.

User avatar
Phantom
Posts: 58
Joined: 8 years ago
Location: Cuba
Gender: None specified

Re: 1201 - Select Your Ropes

Post by Phantom » 8 years ago

I solve this problem… and I think the answer is not the solution to the question…

User avatar
ymondelo20
Posts: 1968
Joined: 8 years ago
Location: Universidad de las Ciencias Informáticas
Gender: None specified
Contact:

Re: 1201 - Select Your Ropes

Post by ymondelo20 » 8 years ago

The output sample is ok...

See that for ropes of values 10, 1 and 15 (sample 1)... we can make 7 combinations...

- We use only the rope with value 10... and we can not lift an object with weight more than 10.
- We use only the rope with value 1... and we can not lift an object with weight more than 1.
- We use only the rope with value 15... and we can not lift an object with weight more than 15.

- We use the ropes with values 10 and 1... and we can not lift an object with weight more than 2.
- We use the ropes with values 15 and 1... and we can not lift an object with weight more than 2.
- We use the ropes with values 10 and 15... and we can not lift an object with weight more than 20.

- We use all the ropes... and we can not lift an object with weight more than 3.

The weight of the heaviest object that can be lifted is 20...

Best Regards...
"Every problem has a simple, fast and wrong solution" OJ's Main Law. ;)

Post Reply

Return to “Problem set”