随笔分类 -  数据结构

摘要:"题目链接" Problem Description哈利波特在魔法学校的必修课之一就是学习魔咒。据说魔法世界有100000种不同的魔咒,哈利很难全部记住,但是为了对抗强敌,他必须在危急时刻能够调用任何一个需要的魔咒,所以他需要你的帮助。给你一部魔咒词典。当哈利听到一个魔咒时,你的程序必须告诉他那... 阅读全文
posted @ 2015-11-14 15:56 Oyking 阅读(412) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5458Problem DescriptionGiven an undirected connected graphGwithnnodes andmedges, with possibly repeated... 阅读全文
posted @ 2015-09-19 17:51 Oyking 阅读(842) 评论(3) 推荐(1)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5153In an infinite chess boar... 阅读全文
posted @ 2015-05-15 21:35 Oyking 阅读(475) 评论(0) 推荐(0)
摘要:Long long ago there is a strong tribe living on the earth. They always have wars and eonquer others.One day, there is another tribe become their targe... 阅读全文
posted @ 2015-05-13 20:09 Oyking 阅读(727) 评论(0) 推荐(0)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&category=648&page=show_problem&problem=5160There is a tree with N no... 阅读全文
posted @ 2015-05-12 23:56 Oyking 阅读(818) 评论(3) 推荐(0)
摘要:DescriptionSC省MY市有着庞大的地下水管网络,嘟嘟是MY市的水管局长(就是管水管的啦),嘟嘟作为水管局长的工作就是:每天供水公司可能要将一定量的水从x处送往y处,嘟嘟需要为供水公司找到一条从A至B的水管的路径,接着通过信息化的控制中心通知路径上的水管进入准备送水状态,等到路径上每一条水管... 阅读全文
posted @ 2015-02-17 16:41 Oyking 阅读(272) 评论(0) 推荐(0)
摘要:题目链接:https://icpcarchive.ecs.baylor.edu/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4156题目拷贝难度大我就不复制了。题目大意:维护一个字符串,要求支持插入、删除操作... 阅读全文
posted @ 2015-02-02 23:50 Oyking 阅读(407) 评论(0) 推荐(0)
摘要:题目链接:http://www.spoj.com/problems/COT3/Alice and Bob are playing a game on a tree of n nodes.Each node is either black or white initially.They take tu... 阅读全文
posted @ 2015-02-01 22:49 Oyking 阅读(1258) 评论(0) 推荐(1)
摘要:题目链接:http://www.spoj.com/problems/COT2/You are given a tree withNnodes.The tree nodes are numbered from1toN.Each node has an integer weight.We will as... 阅读全文
posted @ 2015-02-01 17:36 Oyking 阅读(1989) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=5029Problem DescriptionThe soil is cracking up because of the drought and the rabbit kingdom is facing ... 阅读全文
posted @ 2014-09-22 00:13 Oyking 阅读(1175) 评论(0) 推荐(0)
摘要:Problem DescriptionYou are given a tree with N nodes which are numbered by integers 1..N. Each node is associated with an integer as the weight.Your t... 阅读全文
posted @ 2014-09-18 14:55 Oyking 阅读(989) 评论(9) 推荐(1)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4031Problem DescriptionToday is the 10th Annual of “September 11 attacks”, the Al Qaeda is about to att... 阅读全文
posted @ 2014-08-26 18:43 Oyking 阅读(488) 评论(0) 推荐(0)
摘要:题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=3110Description有N个位置,M个操作。操作有两种,每次操作如果是1 a b c的形式表示在第a个位置到第b个位置,每个位置加入一个数c如果是2 a b c形式,表示询问从第a个位置... 阅读全文
posted @ 2014-08-11 22:43 Oyking 阅读(211) 评论(0) 推荐(0)
摘要:题目链接:http://acdream.info/problem?pid=1157Problem Description由3钟类型操作:1)D L R(1 2 #include 3 #include 4 #include 5 using namespace std; 6 7 c... 阅读全文
posted @ 2014-08-09 22:37 Oyking 阅读(254) 评论(0) 推荐(0)
摘要:Problem Description瑶瑶(tsyao)是某知名货运公司(顺丰)的老板,这个公司很大,货物运输量极大,因此公司修建了许多交通设施,掌控了一个国家的交通运输。这个国家有n座城市,公司的总部在1号城市。公司下管辖的有m条道路和n-1段火车线路。这m条道路和n-1条火车线路都可以用u来表示... 阅读全文
posted @ 2014-08-07 17:18 Oyking 阅读(366) 评论(0) 推荐(0)
摘要:Problem Description刚学完后缀数组求回文串的瑶瑶(tsyao)想到了另一个问题:如果能够对字符串做一些修改,怎么在每次询问时知道以某个字符为中心的最长回文串长度呢?因为瑶瑶整天只知道LOL,当他知道自己省选成绩的时候就天天在LOL,导致现在的她实在是太弱了,根本解决不了这个问题,于... 阅读全文
posted @ 2014-08-07 10:49 Oyking 阅读(328) 评论(0) 推荐(0)
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=4897Problem DescriptionThere is an old country and the king fell in love with a devil. The devil always... 阅读全文
posted @ 2014-08-02 15:46 Oyking 阅读(414) 评论(0) 推荐(0)
摘要:题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2112The Company Dynamic Rankings has developed a new kind of computer that is no lon... 阅读全文
posted @ 2014-08-01 23:50 Oyking 阅读(435) 评论(0) 推荐(0)
摘要:In mathematical terms, the sequenceFnof Fibonacci numbers is defined by the recurrence relationF1 = 1;F2 = 1;Fn = Fn - 1 + Fn - 2(n > 2).DZY loves Fib... 阅读全文
posted @ 2014-07-16 14:46 Oyking 阅读(796) 评论(0) 推荐(0)
摘要:Problem DescriptionFor a sequence S1, S2, ... , SN, and a pair of integers (i, j), if 1 2 #include 3 #include 4 #include 5 using namespace std... 阅读全文
posted @ 2014-05-02 22:17 Oyking 阅读(403) 评论(0) 推荐(0)