Problem E: WeddingUp to thirty couples will 
attend a wedding feast, at which they will be seated on either side of a long 
table. The bride and groom s...
                            
                            
                                分类:
其他好文   时间:
2014-05-05 22:10:59   
                                阅读次数:
373
                             
                    
                        
                            
                            
                                Suppose there are 5 types of coins: 50-cent, 
25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins 
for a given amount of mone...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 12:00:00   
                                阅读次数:
363
                             
                    
                        
                            
                            
                                最长公共子系列,简单的dp,不过注意有空格,所以,在读字符串的时候,尽量用gets读,这样基本没问题#include#include#include#includeusing 
namespace std;int dp[1001][1001];int MAX(int x,int y){ if (...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 11:34:41   
                                阅读次数:
294
                             
                    
                        
                            
                            
                                题目如下:
``Accordian'' Patience 
You are to simulate the playing of games of ``Accordian'' patience, the rules for which are as follows:
    Deal cards one by one in a row from left to right, no...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 09:08:31   
                                阅读次数:
329
                             
                    
                        
                            
                            
                                题目链接:1371 - Period
题意:给定两个字符串,可以把第二个字符串分成若干份,然后由第一个字符串去操作得到每个分出来的字符串,代价为其中的最大值,要求代价的最小值
思路:第一个字符串长度为50,所以答案肯定不会超过50,可以二分答案0到50,不二分的话直接就超时了,然后每次判断进行dp操作,类似LCS问题,只不过原来是相同的+1,现在变成不同的+1,因为不同的肯定就要进行操作了,然...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 09:00:23   
                                阅读次数:
274
                             
                    
                        
                            
                            
                                题意:有a个村庄、b个城镇, 编号分别为:1—a , a+1——a+b 。 有双神奇的鞋,可以瞬时移动,可以使用k次,每次可以移动L , 但穿这双鞋的时候,不能经过城镇 , 问:从a+b 到 1 最短距离是多少?
刚开始看这个题时 , 一点思路都没有 , dp类型的题目做得太少了。
解法:进行状态压缩, 用点+使用鞋子的次数 , 来表示一个状态 , d[i][k] , 表示到 ...
                            
                            
                                分类:
其他好文   时间:
2014-05-04 00:21:00   
                                阅读次数:
383
                             
                    
                        
                            
                            
                                题目链接:1372 - Log Jumping
题意:给定一些n个木板的起始位置和长度k,相重叠的木板可以互相跳跃,求能构成环的最大数量。
思路:先按起始位置排序,然后每次多一个木板就去判断他和前一个和前前一个能不能互相跳跃,如果可以的话就可以多加上这个木板。
代码:
#include 
#include 
#include 
using namespace std;
#define ma...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 21:44:03   
                                阅读次数:
247
                             
                    
                        
                            
                            
                                仙人掌图(有向):同时满足:1强连通;2任何边不在俩个环中。
个人理解:其实就是环之间相连,两两只有一个公共点,(其实可以缩块),那个公共点是割点。HDU数据弱,网上很多错误代码和解法也可以过。
个人解法:
我认为:
 :仙人掌图必然是欧拉图!这样只用“入度=出度”就可以简单地判断强连通(欧拉图显然强连通)了!而且这个必要(不充分)条件还秒杀好多数据(强连通++)。
      个人证明...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 21:38:39   
                                阅读次数:
250
                             
                    
                        
                            
                            
                                【题目】
B
Age Sort
Input: Standard Input
Output: Standard Output
 
You are given the ages (in years) of all people of a country with at least 1 year of age. You kn...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 16:51:42   
                                阅读次数:
427
                             
                    
                        
                            
                            
                                【题目】
Problem C
CALCULATOR CONUNDRUM
Alice got a hold of an old calculator that can display n digits. She was bored enough to come up with the following time waster.
She enters a number k t...
                            
                            
                                分类:
其他好文   时间:
2014-05-03 15:37:03   
                                阅读次数:
308