# URAL 1928 1962 1939 1994

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 in, dp[n][centra][0]=dp[n-i][1-centra][1] + i, dp[n][centra][1]=dp[n⑴][1-centra][0], and when k>n, 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 n=m, and the answer is 2 if n>2. Each chain should contain at most 1 inner cycle which indicates two people want to sit with each other. For every chain it could be reversed, and it could be placed anywhere except the chain contains people 1. Denote the number of chains by k, the permutation of the chains is (k?1)!, denote the number of chains whose node number is larger than 1 as l, the number of available arrangements is (k?1)!?2l.

Accepted Code

### URAL1939 First Seal

Let t=H?hx, S_1=v?t?l, S_2=v22a, if S1<S2 then the vehicle will fall to pieces anyway.

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 0ix+y and 0jmin(i,y) where i is the number of people to be excluded, j is the number of spies in them. The expectation dp[x][y] will be max_i=0x+y_j=0min(i,y)dp[x?(i?j)][y?j]?C_xi?j?C_yjC_x+yi.

Accepted Code

1. 本站所有资源来源于用户上传和网络，如有侵权请邮件联系站长！
2. 分享目的仅供大家学习和交流，您必须在下载后24小时内删除！
3. 不得使用于非法商业用途，不得违反国家法律。否则后果自负！
4. 本站提供的源码、模板、插件等等其他资源，都不包含技术服务请大家谅解！
5. 如有链接无法下载、失效或广告，请联系管理员处理！
6. 本站资源售价只是赞助，收取费用仅维持本站的日常运营所需！
7. 本站源码并不保证全部能正常使用，仅供有技术基础的人学习研究，请谨慎下载
8. 如遇到加密压缩包，请使用WINRAR解压,如遇到无法解压的请联系管理员！

### 1 评论

1. After all, what a great site and informative posts, I will upload inbound link – bookmark this web site? Regards, Reader.