
dp问题
傻不拉叽
这个作者很懒,什么都没留下…
展开
-
寒假训练01G:hdu1260
Problem Description Jesus, what a great movie! Thousands of people are rushing to the cinema. However, this is really a tuff time for Joe who sells the film tickets. He is wandering when could he go原创 2018-01-21 18:02:08 · 379 阅读 · 0 评论 -
算法训练:k好数
解题思路 提示里说这是一个dp问题。建一个二维数组,令dp[i][j]表示前i位中第i位的数为j的方案数,状态转移方程为dp[i][j]=dp[i-1][p](p为不与j相邻的任意数)。最后的所求结果为dp[l][i:0–k-1],即前l位以0到k-1为最后一位数的所有方案数之和。代码#includeusing namespace std;#define mod 10000000原创 2018-01-23 11:44:02 · 432 阅读 · 1 评论 -
hdu2196:Computer
Problem Description A school bought the first computer some time ago(so this computer’s id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one o原创 2018-01-30 17:45:39 · 249 阅读 · 0 评论 -
poj3107:Godfather
Problem Description Last years Chicago was full of gangster fights and strange murders. The chief of the police got really tired of all these crimes, and decided to arrest the mafia leaders.Unfortu原创 2018-01-31 11:22:01 · 251 阅读 · 0 评论 -
poj3140:Contestants Division
Problem Description In the new ACM-ICPC Regional Contest, a special monitoring and submitting system will be set up, and students will be able to compete at their own universities. However there’s on原创 2018-02-01 11:54:44 · 227 阅读 · 0 评论 -
寒假训练01E:hdu1087
Problem Description Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this game, so I introduce it to yo原创 2018-01-18 18:25:53 · 286 阅读 · 0 评论 -
寒假训练01C:hdu1069
Problem Description A group of researchers are designing an experiment to test the IQ of a monkey. They will hang a banana at the roof of a building, and at the mean time, provide the monkey with som原创 2018-01-18 17:21:41 · 207 阅读 · 0 评论 -
德玛西亚万岁
链接:https://www.nowcoder.com/acm/contest/74/F 来源:牛客网题目描述 德玛西亚是一个实力雄厚、奉公守法的国家,有着功勋卓著的光荣军史。这里非常重视正义、荣耀、职责的意识形态,这里的人民为此感到强烈自豪。有一天他们想去制裁邪恶的比尔吉沃特,于是派遣了自己最优秀的战士。结果比尔吉沃特领土太小,只有长为n宽为m共计n*m块土地,原创 2018-02-02 18:29:28 · 879 阅读 · 0 评论 -
hdu1520:Anniversary party
Problem Description There is going to be a party to celebrate the 80-th Anniversary of the Ural State University. The University has a hierarchical structure of employees. It means that the superviso原创 2018-01-30 11:36:06 · 181 阅读 · 0 评论