About 17-minute Bridge

Source: Internet
Author: User

This is the question I encountered when I went to Guangzhou Guangxiang Information Technology Co., Ltd. for an interview and testing today. the four people in A, B, and C should bridge the bridge in the dark. A bridges the bridge for 1 minute, B 2 minutes, C 5 minutes, and D 10 minutes. when crossing the bridge, there is only one flashlight to follow the path, and only two people can cross the bridge at a time. in addition, the flashlight cannot be thrown back. It can only be carried back by people who have crossed the bridge. the requirement of the question is to let four people bridge the bridge within 17 minutes.
At the beginning, I thought that A and B would bridge the bridge, and then a would bring a person back each time, but this would take 19 minutes. 17 minutes to complete.
Because my idea is that the number of past times is fixed. because two people pass each time and there are four bridges in total, we can only try to save time when returning a flashlight from the bridge. therefore, the best result is that Jia will return to and from the bridge.
In fact, this problem is a matter of overall planning and should not be calculated as I previously thought. one idea in the overall optimization algorithm is to find the optimal overall result, rather than the local optimum. in general, local optimization may not necessarily optimize the overall condition.
The answer to this bridge question is:
It takes two minutes for both parties to pass the same period of time (1 and 2;
It takes one minute for a to return data;
It takes 10 minutes for bingding to go through (5 and 10;
It takes 2 minutes for B to return data;
It takes 2 minutes for both parties to pass the same period of time (1 and 2.

17 minutes in total

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.