- 博客(13)
- 收藏
- 关注
原创 hdu2586(LCA最近公共祖先)
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3653 Accepted Submission(s): 1379Problem DescriptionThere are n
2013-11-28 15:06:01 676
原创 LCA最近公共祖先(least common ancestors)
#include"stdio.h"#include"string.h"#include"iostream"#include"queue"#define M 111111using namespace std;struct st{ int u,v,next,w;}edge[M*2];int rank[M],head[M],t,pre[M],use[M],
2013-11-28 09:30:00 828
原创 111
#include"stdio.h"#include"string.h"#include"iostream"using namespace std;const int M=41111;int f[M];struct st{ int x,y;}node[M];int finde(int x,int L,char ch){ if(x!=f[
2013-11-26 13:34:44 602
原创 poj1703 Find them, Catch them 并查集
poj(1703)Find them, Catch themTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 26992 Accepted: 8188DescriptionThe police office in Tadu City deci
2013-11-24 13:36:03 782
原创 关于背包的注意事项
完全背包:1:如果求最大价值且恰好装满,那么在初始化时将dp[0]为0, 其余为负无穷大2:如果求最小价值且恰好装满,那么在初始化时将dp[0]为0, 其余为正无穷大3:如果没有要求恰好装满,则dp[0……n]全初始化为0//提示:在平时求最大值时,一般初始化max为负无穷大,求最小值时,一般初始化min为正无穷大*/
2013-11-21 14:38:50 963
原创 codeforces343A A. Rational Resistance
点击打开链接A. Rational Resistancetime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputMad scientist Mike is building a
2013-11-21 14:18:05 1032
原创 hdu(1171)多重背包
hdu(1171)Big Event in HDUTime Limit:10000/5000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19752 Accepted Submission(s): 6900Problem DescriptionN
2013-11-21 09:30:41 836
原创 利用并查集求最大生成树和最小生成树(nlogn)
hdu1233还是畅通工程Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 21371 Accepted Submission(s): 9515Problem Description某省调查乡村交通状况,
2013-11-21 08:45:54 1440
原创 字符串二分查找
字符串二分查找#include"stdio.h"#include"string.h"#include"iostream"#include"stdlib.h"using namespace std;char a[1001][22];char ch[22];int cmp(const void *a,const void *b){return strcmp(
2013-11-17 12:51:46 1521
原创 map容器
map容器一般用于对字符串进行编号,主要用于建图方面,例如把城市名按数字进行编号#include"stdio.h"#include"string.h"#include"iostream"#include"map"using namespace std;mapmp;int main(){ int i,n; char ch[23]; scanf("%d"
2013-11-17 12:32:36 505
原创 hdu1247(字典树+枚举)
Hat’s Words(hdu1247)Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6156 Accepted Submission(s): 2289Problem DescriptionA hat’s word is
2013-11-16 21:52:05 869
原创 hdu1251(字典树)
统计难题(hdu1251)Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 131070/65535 K (Java/Others)Total Submission(s): 14730 Accepted Submission(s): 6347Problem DescriptionIgnatius最近遇到一个难题,老师交
2013-11-16 21:40:10 774
原创 字典树
#include"string.h"#include"stdio.h"#include"queue"#include"iostream"#include"stdlib.h"#define M 10001using namespace std;struct node{ int next[28];//记录当前字母编号的儿子字母编号 int w;//记录每个单词的编号
2013-11-16 21:26:16 758
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人