每一种货物都是独立的,分成k次最小费用最大流即可! 1: /** 2: 因为e ==0 所以 
pe[v] pe[v]^1 是两条相对应的边 3: E[pe[v]].c -= aug; E[pe[v]^1].c += aug; 4: 5: */ 6: 
#include 7: #include 8: #...
                            
                            
                                分类:
其他好文   时间:
2014-05-08 13:49:21   
                                阅读次数:
290
                             
                    
                        
                            
                            
                                1 /* 2 
题意:给出N个单词,一个单词的头字母和另一个单词的尾字母相同则可以相连,问这N个单词是否能完全相连成一行 3 4 题解:求欧拉路径 5 
首先以每个单词的首字母和尾字母为点并且连边,然后用DFS求该图是否连通,然后根据点的入度和出度判断是否存在 6 欧拉路径或者欧拉回路(存在回路也是.....
                            
                            
                                分类:
其他好文   时间:
2014-05-08 13:48:48   
                                阅读次数:
262
                             
                    
                        
                            
                            
                                Communication SystemTime Limit:1000MSMemory 
Limit:10000KTotal Submissions:22380Accepted:7953DescriptionWe have received an 
order from Pizoor Communica...
                            
                            
                                分类:
其他好文   时间:
2014-05-08 11:19:16   
                                阅读次数:
278
                             
                    
                        
                            
                            
                                链接:http://poj.org/problem?id=1775
Description
John von Neumann, b. Dec. 28, 1903, d. Feb. 8, 1957, was a Hungarian-American mathematician who made important contributions to the foundations of m...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 23:57:32   
                                阅读次数:
402
                             
                    
                        
                            
                            
                                点击打开链接
ROADS
Time Limit: 1000MS
 
Memory Limit: 65536K
Total Submissions: 10202
 
Accepted: 3786
Description
N cities named with numbers 1 ... N are connected with o...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 23:42:01   
                                阅读次数:
617
                             
                    
                        
                            
                            
                                Hotter Colder
Time Limit: 1000MS
 
Memory Limit: 65536K
Total Submissions: 2343
 
Accepted: 981
Description
The children's game Hotter Colder is played as follows. Player A...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 23:39:58   
                                阅读次数:
590
                             
                    
                        
                            
                            
                                题意:题目按字典序给你多个字符串,判断如果一个字符串通过加,减,变一个字母的情况下可以变成另一个字符串的话,就代表他们之间有一个阶梯,求最多的阶梯
思路:首先我们应该想到这个有点LIS的感觉,然后我们可以采用记忆化搜索,然后就是每当一个字符串进行相应的变化后就去查找后面是否有这个字符串,依次找下去,判断最大值,重点是要通过HASH来优化
#include 
#include 
#include...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 23:01:04   
                                阅读次数:
356
                             
                    
                        
                            
                            
                                题目链接建个图,套个模板。#include #include #include 
#include #include #include #include #include using namespace std;#define INF 
0x3ffffffstruct node{ int u,v,...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 21:21:36   
                                阅读次数:
396
                             
                    
                        
                            
                            
                                一.单串匹配问题poj2406(求字符串的周期)利用next[ 
]性质,ans=next[len]%(len-next[len])==0?next[len]/(len-next[len]):1;poj2752(求所有相同的前后缀)利用next[ 
]性质,pos=next[pos](不断向前找)nex...
                            
                            
                                分类:
其他好文   时间:
2014-05-07 20:35:11   
                                阅读次数:
317