XGG Blog
- URAL1928 Another Ecology Problem
- URAL1962 In Chinese Restaurant
- URAL1939 First Seal
- URAL1994 The Emperor’s plan
URAL1928 Another Ecology Problem
Let dp[n][centra][0]
be the maximum money the centra can get when there is n
billions zollars in the budget and is the current centra’s turn to request for money,and let dp[n][centra][1]
be the minimum money the contender can get when money is maximized for the current centra. For dp[n][centra][0]=dp[n-i][1-centra][1] + i
,dp[n][centra][1]=dp[n⑴][1-centra][0]
,and when dp[n][centra][0]=m
,dp[n][centra][1]=0
. Find the maximum dp[n][centra][0]
and the minimum dp[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) could only appear when there is only one set and 2
if 1
. Denote the number of chains by k
,the permutation of the chains is l
,the number of available arrangements is
Accepted Code
URAL1939 First Seal
Let
Accepted Code
URAL1994 The Emperor’s plan
Let dp[x][y]
be the expected number of senators before night,x
is the number of senators and y
is the number of spies. In each night,y
senators will be removed thus x -= y
is executed. In each day,enumerate dp[x][y]
will be
Accepted Code