随笔分类 - ACM ( 数据结构 )
线段树入门 (zz)
摘要:[代码]接着回到线段树上来,线段树是建立在线段的基础上,每个结点都代表了一条线段 [a , b]。长度为1的线段成为元线段。非元线段都有两个子结点,左结点代表的线段为[a , (a + b ) / 2],右结点代表的线段为[( a + b ) / 2 , b]。图一就是一棵长度范围为[1 , 10]的线段树。 长度范围为[1 , L] 的一棵线段树的深度为log ( L - 1 ) + 1。这个显...
阅读全文
HDOJ 2642 HDU 2642 Stars ACM 2642 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=2642题目描述:[代码]Yifenfei is a romantic guy and he likes to count the stars in the sky.To make the problem easier,we co...
阅读全文
霍夫曼编码
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--霍夫曼编码是一种被广泛应用而且非常有效的数据压缩技术,根据待压缩数据的特征,一个可压缩掉20%~90%。这里考虑的数据指的是字...
阅读全文
HDOJ 2227 HDU 2227 Find the nondecreasing subsequences ACM 2227 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=2227题目描述:[代码]How many nondecreasing subsequences can you find in the sequence S = {s1, s2, s3, ...., sn} ? For exa...
阅读全文
HDOJ 1541 HDU 1541 Stars ACM 1541 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1541题目描述:[代码]Astronomers often examine star maps where stars are represented by points on a plane and each star has ...
阅读全文
HDOJ 1892 HDU 1892 See you~ ACM 1892 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=1892题目描述:代码Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlighter.com/--Seeyou~...
阅读全文
HDOJ 1166 HDU 1166 敌兵布阵 ACM 1166 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1166题目描述:[代码]C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采...
阅读全文
极度 YM....自己用trie写了个伪 map....( HDU 1075 )
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋[代码][代码]MiYu原创, 转帖请注明 : 转载自 ______________白白の屋 http://www.cnblog.com/MiYuAuthor By : MiYuTest : 4Program : 1075*/#include <iostream>#include <string>u...
阅读全文
HDOJ 1247 HDU 1247 Hat’s Words ACM 1247 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址 : http://acm.hdu.edu.cn/showproblem.php?pid=1247题目描述:[代码]A hat’s word is a word in the dictionary that is the concatenation of exactly two other words ...
阅读全文
HDOJ 1800 HDU 1800 Phone List ACM 1800 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1800题目描述:[代码]In the year 8888, the Earth is ruled by the PPF Empire . As the population growing , PPF needs to fin...
阅读全文
HDOJ 1671 HDU 1671 Phone List ACM 1671 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1671题目描述:[代码]Given a list of phone numbers, determine if it is consistent in the sense that no number is the prefi...
阅读全文
HDOJ 1251 HDU 1251 统计难题 ACM 1251 IN HDU
摘要:MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址: http://acm.hdu.edu.cn/showproblem.php?pid=1251题目描述:[代码]Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀).Input输入数据的第一部分是一...
阅读全文
HDOJ HDU 2094 产生冠军 ACM 2094 IN HDU
摘要://MiYu原创, 转帖请注明 : 转载自______________白白の屋题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=2094题目描述:ProblemDescription有一群人,打乒乓球比赛,两两捉对撕杀,每两个人之间最多打一场比赛。球赛的规则如下:如果A打败了B,B又打败了C,而A与C之间没有进行过比赛,那么就认定,A一定能打败C。如果A...
阅读全文
浙公网安备 33010602011771号