03 2013 档案

摘要:搜索专题(Newer)题解:A bfs依次遍历周围的八个方向(马走日)B bfs注意记录当前方向和转弯数C bfs入门题目,注意要清空队列D dfs入门,周围加边四个方向深搜即可。E dfs.八连块问题 只要周围的八个方向的图是一样的,则都算是同一个八连块,记录共有多少个八连块即可。D dfs 深度遍历每一条路即可,只是要边遍历边记录路径,最后输出路径就好了E dfs+奇偶剪枝优化IDTitle13/19Problem AKnight Moves6/38Problem B逃离迷宫8/40Problem CCatch That Cow8/8Prob... 阅读全文
posted @ 2013-03-30 21:55 free斩 阅读(201) 评论(0) 推荐(0)
摘要:训练赛(Older)#001题解(F):1不知道 二维多重背包。。。2多重背包模板题3完全背包模板题4线段树求区间最值 模板题5幂取模乱搞6DFS7水题8水题IDOriginTitle2/14Problem AHDU 3496Watch The Movie10/23Problem BHDU 2191悼念512汶川大地震遇难同胞――珍惜现在,感恩生活8/11Problem CHDU 4508湫湫系列故事――减肥记I5/9Problem DPOJ 3264Balanced Lineup6/22Problem EHDU 4506小明系列故事――师兄帮帮忙4/5... 阅读全文
posted @ 2013-03-26 16:04 free斩 阅读(247) 评论(0) 推荐(0)
摘要:转载来自:http://lynclass.blog.sohu.com/84582061.html匹配中文字符的正则表达式: [\u4e00-\u9fa5], [\一-\龥]可以.评注:匹配中文还真是个头疼的事,有了这个表达式就好办了匹配双字节字符(包括汉字在内):[^\x00-\xff]评注:可以用来计算字符串的长度(一个双字节字符长度计2,ASCII字符计1)匹配空白行的正则表达式:\n\s*\r评注:可以用来删除空白行匹配HTML标记的正则表达式:]*>.*?|评注:网上流传的版本太糟糕,上面这个也仅仅能匹配部分,对于复杂的嵌套标记依旧无能为力匹配首尾空白字符的正则表达式:^\s*| 阅读全文
posted @ 2013-03-25 16:33 free斩 阅读(145) 评论(0) 推荐(0)
摘要:Balanced LineupTime Limit:5000MSMemory Limit:65536KTotal Submissions:26435Accepted:12401Case Time Limit:2000MSDescriptionFor the daily milking, Farmer John'sNcows (1 ≤N≤ 50,000) always line up in the same order. One day Farmer John decides to organize a game of Ultimate Frisbee with some of the 阅读全文
posted @ 2013-03-24 20:34 free斩 阅读(184) 评论(0) 推荐(0)
摘要:下面的源代码是修改的了时间差精确到了纳秒级别的了,但是还是感觉很有误差。无论怎么测,总是快排比归并快,即使是测试数据的数组长度在10以内。 前面一样的程序写的是时间精确到微秒级的,数组长度大概在一万以内的,就是归并排序快了,大于这个长度的快速排序比较快。综合上面的情况,数组小时,二者时间差也不会太多,所以个人认为还是快速排序比较好了,唉还是觉得归并比较简单好写,弱爆了啊。。。#include<cstdio>#include<Windows.h>#include<ctime>#include<cstdlib>#include<cstring& 阅读全文
posted @ 2013-03-21 10:51 free斩 阅读(1553) 评论(0) 推荐(0)
摘要:第一场题目:点击打开链接A-B-C-D-E -Lowest Common Multiple Plus hduLowest Common Multiple PlusTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23786Accepted Submission(s): 9649Problem Description求n个数的最小公倍数。Input输入包含多个测试实例,每个测试实例的开始是一个正整数n,然后是n个正整数。Output为每组测试数据输 阅读全文
posted @ 2013-03-21 01:50 free斩 阅读(189) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=2037CSUST链接:http://acmore.net:8080/contest/view.action?cid=2#problem/F今年暑假不ACTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 18515Accepted Submission(s): 9625Problem Description“今年暑假不AC?”“是的。”“那你干什么呢?” 阅读全文
posted @ 2013-03-21 00:48 free斩 阅读(189) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=3280CSUST:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20437#problem/C转载来自:http://blog.sina.com.cn/s/articlelist_1836701754_0_1.htmlCheapest PalindromeTime Limit:2000MSMemory Limit:65536KTotal Submissions:4305Accepted:2091DescriptionKeeping track of all the co 阅读全文
posted @ 2013-03-15 20:14 free斩 阅读(610) 评论(1) 推荐(1)
摘要:原题链接:http://poj.org/problem?id=1159博文转载链接:http://blog.sina.com.cn/s/blog_6d79d83a01016iqg.htmlPalindromeTime Limit:3000MSMemory Limit:65536KTotal Submissions:45704Accepted:15580DescriptionA palindrome is a symmetrical string, that is, a string read identically from left to right as well as from righ 阅读全文
posted @ 2013-03-15 19:28 free斩 阅读(501) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=3624我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20437#problem/A欢迎来水Charm BraceletTime Limit:1000MSMemory Limit:65536KTotal Submissions:14963Accepted:6840DescriptionBessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she 阅读全文
posted @ 2013-03-13 22:08 free斩 阅读(161) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=3928我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=20357#problem/APing pongTime Limit:1000MSMemory Limit:65536KTotal Submissions:1215Accepted:452DescriptionN(3<=N<=20000) ping pong players live along a west-east street(consider the street as a line se 阅读全文
posted @ 2013-03-12 14:29 free斩 阅读(364) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1022Train Problem ITime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 13410Accepted Submission(s): 4935Problem DescriptionAs the new term comes, the Ignatius Train Station is very busy nowadays. A lot of 阅读全文
posted @ 2013-03-11 21:14 free斩 阅读(218) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=2299Ultra-QuickSortTime Limit:7000MSMemory Limit:65536KTotal Submissions:31043Accepted:11066DescriptionIn this problem, you have to analyze a particular sorting algorithm. The algorithm processes a sequence of n distinct integers by swapping two adjacent sequence eleme 阅读全文
posted @ 2013-03-08 21:56 free斩 阅读(332) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1166敌兵布阵Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 23954Accepted Submission(s): 10387Problem DescriptionC国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地 阅读全文
posted @ 2013-03-08 19:54 free斩 阅读(197) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1233CSUST链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19760#problem/D还是畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 17151Accepted Submission(s): 7688Problem Description某省调查乡村交通状况,得到的 阅读全文
posted @ 2013-03-05 21:48 free斩 阅读(163) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1232CSUST链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19760#problem/C畅通工程Time Limit: 4000/2000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19633Accepted Submission(s): 10103Problem Description某省调查城镇交通状况,得到现有 阅读全文
posted @ 2013-03-04 20:22 free斩 阅读(185) 评论(0) 推荐(0)
摘要:PS:第一道并查集题目Orz链接:http://acm.hdu.edu.cn/showproblem.php?pid=1878CSUST链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=10462#problem/A欧拉回路Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 7271Accepted Submission(s): 2548Problem Description欧拉回路是 阅读全文
posted @ 2013-03-03 21:53 free斩 阅读(369) 评论(7) 推荐(0)
摘要:【转自】http://www.cnblogs.com/cherish_yimi/archive/2009/10/11/1580839.html文章作者:yx_th000文章来源:Cherish_yimi(http://www.cnblogs.com/cherish_yimi/) 转载请注明,谢谢合作。 [本文新址:http://www.ahathinking.com/archives/10.html]昨天和今天学习了并查集和trie树,并练习了三道入门题目,理解更为深刻,觉得有必要总结一下,这其中的内容定义之类的是取自网络,操作的说明解释及程序的注释部分为个人理解。并查集学习:l并查集:(un 阅读全文
posted @ 2013-03-02 21:40 free斩 阅读(202) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=2488我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/AA Knight's JourneyTime Limit:1000MSMemory Limit:65536KTotal Submissions:23452Accepted:7944DescriptionBackgroundThe knight is getting bored of seeing the same black and white squares again 阅读全文
posted @ 2013-03-02 21:32 free斩 阅读(386) 评论(0) 推荐(0)
摘要:DFS 水题原题链接:http://poj.org/problem?id=3620我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/BAvoid The LakesTime Limit:1000MSMemory Limit:65536KTotal Submissions:5563Accepted:2995DescriptionFarmer John's farm was flooded in the most recent storm, a fact only aggravated by t 阅读全文
posted @ 2013-03-02 19:08 free斩 阅读(506) 评论(0) 推荐(0)
摘要:最短路的简单应用问题。原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=3790CSUST链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19760#problem/L最短路径问题Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 6346Accepted Submission(s): 1922Problem Description给你n个 阅读全文
posted @ 2013-03-01 19:16 free斩 阅读(258) 评论(0) 推荐(0)
摘要:原题链接:http://poj.org/problem?id=1062我的链接:http://acm.hust.edu.cn/vjudge/contest/view.action?cid=19651#problem/E昂贵的聘礼Time Limit:1000MSMemory Limit:10000KTotal Submissions:29628Accepted:8296Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯, 阅读全文
posted @ 2013-03-01 17:56 free斩 阅读(192) 评论(0) 推荐(0)