上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页
  2014年9月1日
摘要: ZOJ Problem Set - 2965Accurately Say "CocaCola"! http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2965打表。求含有7或者是7的倍数的数。题目输入p,输出第一个连续出现p个满足... 阅读全文
posted @ 2014-09-01 20:08 gaolzzxin 阅读(169) 评论(0) 推荐(0) 编辑
  2014年8月31日
摘要: Friend Chainshttp://acm.hdu.edu.cn/showproblem.php?pid=4460图的最远两点距离,任意选个点bfs,如果有不能到的点直接-1.然后对于所有距离最远的点都bfs一次。最坏n^2邻接表 1 #include 2 #include 3 #include... 阅读全文
posted @ 2014-08-31 18:23 gaolzzxin 阅读(307) 评论(0) 推荐(0) 编辑
  2014年8月30日
摘要: Draw Somethinghttp://acm.hdu.edu.cn/showproblem.php?pid=4450o(n)统计输入每个数的平方和。 1 #include 2 int main(){ 3 int n,x; 4 while(~scanf("%d",&n),n){ 5... 阅读全文
posted @ 2014-08-30 18:26 gaolzzxin 阅读(262) 评论(0) 推荐(0) 编辑
  2014年8月29日
摘要: GGS-DDUhttp://acm.hdu.edu.cn/showproblem.php?pid=4966建图待补,先做模板了。 1 #include 2 #include 3 #define mt(a,b) memset(a,b,sizeof(a)) 4 const int inf=0x3... 阅读全文
posted @ 2014-08-29 16:28 gaolzzxin 阅读(289) 评论(0) 推荐(0) 编辑
摘要: Minimum Spanning Treehttp://acm.hdu.edu.cn/showproblem.php?pid=4408模板题 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define mt(a,b) ... 阅读全文
posted @ 2014-08-29 13:51 gaolzzxin 阅读(273) 评论(0) 推荐(0) 编辑
摘要: poj 1679http://poj.org/problem?id=1679次小生成树基于prim o(v^2),可以通过次小生成树和最小生成树的值是否相等判断最小生成树是否唯一,若不等,则唯一,反之亦然。 1 #include 2 #include 3 #include 4 #defin... 阅读全文
posted @ 2014-08-29 12:58 gaolzzxin 阅读(186) 评论(0) 推荐(0) 编辑
摘要: hdu 4786 Fibonacci Treehttp://acm.hdu.edu.cn/showproblem.php?pid=4786copyright@ts 算法源于ts,用最小生成树可以求出最小权值,把所有边权取反可以求出最大权值,算法是如果有个斐波那契数在最小到最大值之间,就一定能构成。也... 阅读全文
posted @ 2014-08-29 12:28 gaolzzxin 阅读(210) 评论(0) 推荐(0) 编辑
摘要: poj1251http://poj.org/problem?id=1251prim 1 #include 2 const int inf=0x3f3f3f3f; 3 class Prim{///最小生成树(无向图)o(MV^2)要保证图连通 4 typedef int typec;///边权... 阅读全文
posted @ 2014-08-29 10:17 gaolzzxin 阅读(237) 评论(0) 推荐(0) 编辑
  2014年8月27日
摘要: Lights Against Dudelyhttp://acm.hdu.edu.cn/showproblem.php?pid=477015个位置,所以可以暴力枚举那些放,对于放的再暴力枚举哪个转,对于转的,再枚举转哪个方向。选位置放我用了2进制枚举,选出哪个转和枚举4个方向for循环就行。可以加个小... 阅读全文
posted @ 2014-08-27 22:26 gaolzzxin 阅读(322) 评论(0) 推荐(0) 编辑
摘要: A. Appleman and Easy Taskhttp://codeforces.com/contest/462/problem/A 1 #include 2 const int M=128; 3 char a[M][M]; 4 int dx[]={0,0,1,-1}; 5 int dy[]={... 阅读全文
posted @ 2014-08-27 10:24 gaolzzxin 阅读(134) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 17 下一页