摘要: 简单bfs,处理的时候,用的Map没过,看来这个题得好好考虑考虑时间复杂度了#include#include#include #includeusing namespace std;int visit[10010];int visit2 [10010];int prim(int x){ ... 阅读全文
posted @ 2015-05-22 12:05 袁汉春 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 将已经链接的边的权值设为0即可。但是可能会超时,提交的时候,有一次显示超时,所以这个解法是有问题的,看到有171ms的,实力差的太大了,还是得使劲刷题。/*2015-5-18 951ms*/#include#include#includeusing namespace std;#define INF... 阅读全文
posted @ 2015-05-18 20:11 袁汉春 阅读(137) 评论(0) 推荐(0) 编辑
摘要: ZCC loves stringsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 262144/131072 K (Java/Others)Total Submission(s): 264Accepted Submission(s): 100P... 阅读全文
posted @ 2015-05-17 12:32 袁汉春 阅读(115) 评论(0) 推荐(0) 编辑
摘要: E -Hardwood SpeciesTime Limit:10000MSMemory Limit:65536KB64bit IO Format:%I64d & %I64uSubmitStatusPracticePOJ 2418DescriptionHardwoods are the botanic... 阅读全文
posted @ 2015-05-16 16:58 袁汉春 阅读(138) 评论(0) 推荐(0) 编辑
摘要: A -An easy problemTime Limit:1000MSMemory Limit:32768KB64bit IO Format:%I64d & %I64uSubmitStatusPracticeHDU 2055Descriptionwe define f(A) = 1, f(a) = ... 阅读全文
posted @ 2015-05-16 16:56 袁汉春 阅读(148) 评论(0) 推荐(0) 编辑
摘要: http://acm.hust.edu.cn/vjudge/contest/view.action?cid=78044#problem/B给定两个数 m,n ,让你求在【m,n】范围里,所有数的0的个数。思路: 从个位开始列举,1233,个位是零的情况有124种,这里我们将0算在情况里; 十位是0的... 阅读全文
posted @ 2015-05-16 16:04 袁汉春 阅读(402) 评论(0) 推荐(0) 编辑
摘要: Map的使用,掌握基础STL的使用。#include#include#include#includeusing namespace std;int main(){ int t; scanf("%d",&t); while(t--){ mapm1; ... 阅读全文
posted @ 2015-05-15 20:44 袁汉春 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 给定起点和终点之间的距离 L ,在起点和终点之间存在 n 个点,给出这 n 个点距离起点的距离,求把这n个点中去掉m个点后剩余点之间可能的最小值的最大值(即求 n-m 个点之间距离最小值的最大值) 。首先知道结果必然存在于在不操作的最小值和L之间,答案范围确定。然后就是给定middle含义: 比最小... 阅读全文
posted @ 2015-05-15 10:01 袁汉春 阅读(181) 评论(0) 推荐(0) 编辑