- 博客(4)
- 资源 (1)
- 收藏
- 关注
原创 UVA424高精度加法
One of the first users of BIT’s new supercomputer was Chip Diller. He extended his exploration of powers of 3 to go from 0 to 333 and he explored taking various sums of those numbers. “This supe
2016-11-28 19:00:31 615
原创 HDU1039 Easier Done Than Said?
题目链接:HDU1039 /* 题目大意:验证所设密码可否接受,要求满足以下三个条件: 1、必须包含元音 2、三个连续的字母不能同时为元音或者辅音 3、两个连续的字母不能相同,其中"ee"."o
2016-11-26 13:06:42 344
原创 SPFA模板
/* SPFA求单源最短路径长度 时间复杂度O(KE) */ #include using namespace std; const int maxn=300001; const int inf =0x7ffffff; struct edge { int from,to,w,next; }e[1000001]; int head[maxn]; i
2016-11-04 17:40:08 403
原创 求树的直径算法
/*树的直径是指树的最长简单路。求法: 两遍BFS :先任选一个起点BFS找到最长路的终点,再从终点进行BFS,则第二次BFS找到的最长路即为树的直径; 原理: 设起点为u,第一次BFS找到的终点v一定是树的直径的一个端点 证明: 1) 如果u 是直径上的点,则v显然是直径的终点(因为如果v不是的话,则必定存在另一个点w使得u到w的距离更长,
2016-11-04 13:25:12 11797
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人