![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
ACM
文章平均质量分 79
wenjie2012
这个作者很懒,什么都没留下…
展开
-
Merlininice’s Hometask
Merlininice’s HometaskProblem DescriptionMerlininice dosen’t love math lessons, so he always ditches math class. But as the final exam is coming, now Merlininice is really regret his actions and w原创 2012-08-13 09:14:21 · 512 阅读 · 0 评论 -
hdoj 1430魔板
此题主要考察的是BFS预处理+hash,hash用了康托展开,其中比较纠结的是按字典序进行排序,我一直没弄懂这个地方怎么做,后来看了傻仔大神的解题报告http://www.cppblog.com/notonlysuccess/archive/2009/02/27/75087.aspx#include #include #include #include using namespa原创 2013-03-01 21:01:24 · 360 阅读 · 0 评论 -
POJ 1200 Crazy Search
Rabin-Karp算法题目的测试数据不够强大,太水了,我写的代码有两个地方是有问题的1:我没有确定一个取模的限度,也就是说没有取模,如果测试数据够强,肯定出问题,但是这里又牵扯出一个问题,如果我在每一次相乘的时候取模,使之保证在一个限度,那么我得到的哈希值与字符串是否还对应?我认为是对应的!2:我没有处理冲突,这个地方应该是要处理冲突的,建议使用拉链法处理冲突。 #include原创 2013-03-02 12:20:18 · 226 阅读 · 0 评论 -
POJ 2503 Babelfish
ELFHash算法一看就是个水题,很多方法可以解,最简单的就应该是用map,但是出题的正解应该是使用ELFHash算法。处理冲突,我们用拉链法 #include #include #include #include using namespace std;#define MAXN 1000003struct node{ char m[11]; c原创 2013-03-01 21:07:47 · 196 阅读 · 0 评论 -
hdoj 1671Phone List 字典树
题目有个陷阱:我的思路是如果走到了某个字符串的结尾,那就跳出循环!结果光荣WA了。如果这个字符串的结尾被走过了,那么也要跳出!#include #include #include #include using namespace std;struct node{ int m; int v; node *next[10]; node()原创 2013-03-11 21:32:39 · 822 阅读 · 0 评论 -
hdoj 4287 Intelligent IME 字典树
2012天津赛区网络赛的题,当年被一个大一的学弟A了,今天重温数据结构,做了一下,水题,没多大意义!不能用数字来匹配单词,那样复杂度太大,反过来比较简单!#include #include #include using namespace std;struct node{ int m; node *next[10]; int su; node(原创 2013-03-12 09:17:07 · 805 阅读 · 0 评论 -
POJ 2418 Hardwood Species 二叉搜索树
题目大意:给你很多的树的名称,名称有很多是相同的,请你按字典树输出它们,以及它们所占的比例比较简单,就不多说了,按理来说这个题目用map会简单很多,但是为了锻炼一下二叉搜索树的写法,自己写了一次!#include #include #include #include #include using namespace std;struct node{ char s[50原创 2013-03-11 19:42:18 · 413 阅读 · 0 评论 -
hdu 1254
http://acm.hdu.edu.cn/showproblem.php?pid=1254 BFS+hash,广搜路线,每次小人走都要哈希一下箱子的位置,这样保证走的时候状态是不一样的,然后要注意,这里要用优先队列,时间短的要先弹出来,这个地方值得琢磨,WA了n次!#include #include #include #include #include using nam原创 2013-01-29 17:55:01 · 311 阅读 · 0 评论 -
hdu 4422The Little Girl who Picks Mushrooms
Problem DescriptionIt's yet another festival season in Gensokyo. Little girl Alice planned to pick mushrooms in five mountains. She brought five bags with her and used different bags to collect mush原创 2012-11-02 20:42:08 · 556 阅读 · 0 评论 -
poj 2828 Buy Tickets
很简单的线段树,主要是弄清与原理,每个点保存的是这一段区间还有多少个空位置,把这个想明白了,所有的就都简单了!DescriptionRailway tickets were difficult to buy around the Lunar New Year in China, so we must get up early and join a long queue…The Lu原创 2012-10-05 14:17:56 · 280 阅读 · 0 评论 -
为什么我要注册一个博客?
从大一下学期的时候开始搞ACM,差不多一年半了,今天突然觉得,作为一个ACMer没有一个属于自己的博客,实在是不幸的,为什么这么说呢?没有及时的把自己的思路记录下来!成功还是失败,进取还是退步,一切好像过去了,就过去了!我不是一个好ACMer!........所以,我要开始写博客!原创 2012-08-12 19:18:48 · 300 阅读 · 1 评论 -
Yuna's confusion
Problem DescriptionAfter yuna studies the STL container,she finds the STL powerful for AC.For the k-th number, she is also very familiar with it. Now yuna meets a very similar problem, yuna wants to原创 2012-08-13 09:20:06 · 520 阅读 · 0 评论 -
hdu 1823 Luck and Love 二维线段树
第一次写二维线段树,题目算是简单,就是很多的陷阱;题意比较的简单,就不说了;二维线段树:就是在线段树里面嵌套一个线段树,可是由于结构的原因,一层线段树必须更新到底。如果各位大神有在一维不更新到底的方法,请提出来,我一定改正!代码:#include #include #include #include using namespace std;#define maxn 1原创 2013-04-11 09:31:55 · 408 阅读 · 0 评论