[Game] pirate sharing

Source: Internet
Author: User

There were n (n <= 1000) Greedy pirates who got 100,000 gold coins and decided to divide the stolen goods. They are both savvy and want to maximize their own interests, and adopt the following strategies: 1. First, N people are arranged in order. 2. the hacker number will give the sharing scheme. 3. All people vote. If 50% or more people agree to the vote, the job will be successful. Otherwise, the job will be transferred to 4. 4. Kill the Defender (1 fewer in the total number) and convert it to 2. Your task: determine the maximum number of gold coins that a pirate gets.

 

Question: This question requires a small bend. First, the first person who receives the most money must be the first person. Second, he only needs to give one gold coin to all the odd-numbered people. It can be yy. odd numbers are always limited by even numbers. They are very likely to be unable to get anything, so they will be satisfied as long as they have them. The answer is 100000-(n-1)/2. So easy!

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.