URAL 1928 1962 1939 1994, ural1939

Source: Internet
Author: User

URAL 1928 1962 1939 1994, ural1939

XGG Blog

  • URAL1928 Another Ecology Problem
  • URAL1962 In Chinese Restaurant
  • URAL1939 First Seal
  • URAL1994 The Emperor's plan
URAL1928 Another Ecology Problem

Letdp[n][centra][0]Be the maximum money the centra can get when there isnBillions zollars in the budget and is the current centra's turn to request for money, and letdp[n][centra][1]Be the minimum money the consorcan get when money is maximized for the current centra. I ≤ n ,dp[n][centra][0]=dp[n-i][1-centra][1] + i,dp[n][centra][1]=dp[n-1][1-centra][0], And when K> n ,dp[n][centra][0]=m,dp[n][centra][1]=0. Find the maximumdp[n][centra][0]And the minimumdp[n][centra][1]To solve this problem.

Accepted Code

URAL1962 In Chinese Restaurant

The people form chains and circle. The circle (number of nodes is greater than 2) cocould only appear when there is only one set and N = m , And the answer is2If N> 2 . Each chain shoshould contain at most 1 inner cycle which indicates two people want to sit with each other. For every chain it cocould be reversed, and it cocould be placed anywhere else t the chain contains people1. Denote the number of chainsk, The permutation of the chains is (K−1 )! , Denote the number of chains whose node number is larger than 1l, The number of available arrangements is (K−1 )! Limit 2l .

Accepted Code

URAL1939 First Seal

Let T = h−hx , S_1 = v then t −l , S_2 = v22a , If S1 <S2 Then the vehicle will fall to pieces anyway.

Accepted Code

URAL1994 The Emperor's plan

Letdp[x][y]Be the expected number of senators before night,xIs the number of senators andyIs the number of spies. In each night,ySenators will be removed thusx -= yIs executed. In each day, enumerate 0 ≤ I ≤ x + y And 0 ≤ j ≤ min (I, y) Where I Is the number of people to be excluded, J Is the number of spies in them. The expectationdp[x][y]Will be Max_ I = 0x + y Σ _ j = 0 min (I, y) dp [x − (I −j)] [y −j] ⋅ C_xi −j ⋅ C_yjC_x + yi .

Accepted Code

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.