Four people 17 minutes cross the bridge problem

Source: Internet
Author: User

Problem:

  There are four people need to cross the bridge, the sky is relatively dark, the bridge must use a flashlight. But there is only one flashlight, each time a maximum of two people cross the bridge, so someone must bring the flashlight back and forth. The four of them need 1,2,5,10 minutes to cross the bridge, and two people will cross the bridge at a slower pace. Excuse me, how to cross the bridge within 17 minutes.

Reply:

 Specifically I do not know what the algorithm is contained in the inside ... Just thought for a moment. The key to solving this problem is that people have to go back and forth at least. And, try to get 5 minutes and 10 minutes to walk together, saving more time.

  

  • It takes 2 minutes to cross the bridge first.
  • 2 Go back, spend 2 minutes, total 4 minutes
  • 5,10 Bridge, take 10 minutes, total 14 minutes
  • 1 Go back, spend 1 minutes, total 15 minutes
  • It takes 2 minutes and a total of 17 minutes to cross the bridge.

  

Four people 17 minutes cross the bridge problem

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.