题目:
        链接:点击打开链接
题意:
        求需要修建的公路的最短长度。
算法:
思路:
        prim最小生成树
代码:
#include
#include
#include
using namespace std;
#define MAX 100000000
#define MAXN 110
int map[MAXN][MAXN];
int ...
                            
                            
                                分类:
其他好文   时间:
2014-06-07 01:49:07   
                                阅读次数:
213
                             
                         
                    
                        
                            
                            
                                如下所示 给出2个解法
def euler_problem_18_1():
    """
    this problem spend my half-day but noting to finished ,so bad
    """
    rows = '''
    3
    7 4
    2 4 6
    100 5 9 3
    '''
    ...
                            
                            
                                分类:
编程语言   时间:
2014-06-07 01:28:18   
                                阅读次数:
261
                             
                         
                    
                        
                            
                            
                                【题目】
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and...
                            
                            
                                分类:
其他好文   时间:
2014-06-07 01:17:49   
                                阅读次数:
269
                             
                         
                    
                        
                            
                            
                                题目链接:
http://acm.hdu.edu.cn/showproblem.php?pid=1242
题目:
Rescue
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 14614    Accepted Subm...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 11:57:25   
                                阅读次数:
288
                             
                         
                    
                        
                            
                            
                                延迟标记像极了线段书,不再多说。
区间反转在树伸展到位之后,也变成了简单的递归交换左右儿子。
愈发感觉到伸展树简直太漂亮了,伸展操作更是诱惑到不行 ,总之数据结构太有魅力了。
比较简单,就直接上模板了。
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#include 
#pr...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 08:33:14   
                                阅读次数:
190
                             
                         
                    
                        
                            
                            
                                一切见注释。
#include 
#include 
#include 
#include 
using namespace std;
bool vis[22];
int n;
int ans[22];
int top;
bool isprime(int x)//判断素数
{
    for(int i=2;i<x;i++)
    if(x%i==0)return false;
...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 08:26:47   
                                阅读次数:
201
                             
                         
                    
                        
                            
                            
                                题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1520
题目大意:给定一棵关系树,每个节点有个权值,子节点和父节点不能同时选,问最后能选的最大价值是多少?
解题思路:树形DP入门题。由于子节点与父节点不能同时选,有人可能会用贪心思想,二者选其一肯定最优。其实不然,有可能父节点和子节点都不选,而要选子孙节点。不过只要再往深点想下,就可以得出...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 07:40:29   
                                阅读次数:
255
                             
                         
                    
                        
                            
                            
                                很多的开源软件在安装过程中会出现找不到动态库的问题我在ubuntu12.04安装lxc时,没有出现这问题,但在centos6.5的时候出现了这问题fix:#find / -name  liblxc.so.1#echo "/usr/local/lib/" >> /etc/ld.so.conf#ldconfig...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 06:23:02   
                                阅读次数:
243
                             
                         
                    
                        
                            
                            
                                把横的和竖的分开考虑
//#pragma comment(linker, "/STACK:102400000,102400000")
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
using namespace...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 06:04:58   
                                阅读次数:
238
                             
                         
                    
                        
                            
                            
                                Reward
Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3554    Accepted Submission(s): 1077
Problem Description
Dandelion's uncle i...
                            
                            
                                分类:
其他好文   时间:
2014-06-05 05:59:34   
                                阅读次数:
203