随笔分类 - ACM-HDU
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=6119 解题思路:给出的出发时间和结束时间对有重合的部分进行处理,然后用尺取法找出最后的结果。比赛的时候的确想到了用尺取的想法完成题目,但是代码能力不行没有想出来。 AC代码:
阅读全文
摘要:E-pang Palace was built in Qin dynasty by Emperor Qin Shihuang in Xianyang, Shanxi Province. It was the largest palace ever built by human. It was so
阅读全文
摘要:Using regular expression to define a numeric string is a very common thing. Generally, use the shape as follows: (0|9|7) (5|6) (2) (4|5) Above regular
阅读全文
摘要:Problem Description Nowadays, at least one wrestling match is held every year in our country. There are a lot of people in the game is "good player”,
阅读全文
摘要:Terrorists are around everywhere, they always make troubles by detonating bombs. The terrorist have some gunpowder to make bombs, different gunpowder
阅读全文
摘要:1.hdu--4513 吉哥系列故事——完美队形II http://acm.hdu.edu.cn/showproblem.php?pid=4513 题意:中文题不解释 思路:数字型的manachar算法。将模板中的比较字符改为比较数字就行了。 AC代码: 1 #include <iostream>
阅读全文
摘要:Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一样的字符串,如aba, abba等 Description 给出一个只由小写英文字符a,b,c...y,z组成的字符串S,求S中最长回文串的长度. 回文就是正反读都是一
阅读全文
摘要:关于ac自动机模板是非常重要的,在上一篇文章中已经给出了非常好用的数组类型的模板。下面的题目都是在模板之上进行略微修改就能ac的简单题 1.hdu--3065 病毒侵袭持续中 http://acm.hdu.edu.cn/showproblem.php?pid=3065 题意:统计子串在主串中出现的次
阅读全文
摘要:Description 当太阳的光辉逐渐被月亮遮蔽,世界失去了光明,大地迎来最黑暗的时刻。。。。在这样的时刻,人们却异常兴奋――我们能在有生之年看到500年一遇的世界奇观,那是多么幸福的事儿啊~~ 但网路上总有那么些网站,开始借着民众的好奇心,打着介绍日食的旗号,大肆传播病毒。小t不幸成为受害者之一
阅读全文
摘要:Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重复的单词出现),现在老师要他统计出以某个字符串为前缀的单词数量(单词本身也是自己的前缀). Description Ignatius最近遇到一个难题,老师交给他很多单词(只有小写字母组成,不会有重
阅读全文
摘要:Description During the War of Resistance Against Japan, tunnel warfare was carried out extensively in the vast areas of north China Plain. Generally s
阅读全文
摘要:Description Given n integers. You have two operations: U A B: replace the Ath number by B. (index counting from 0) Q A B: output the length of the lon
阅读全文
摘要:Description Corrupt governors always find ways to get dirty money. Paint something, then sell the worthless painting at a high price to someone who wa
阅读全文
摘要:Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several consecut
阅读全文
摘要:Description C国的死对头A国这段时间正在进行军事演习,所以C国间谍头子Derek和他手下Tidy又开始忙乎了。A国在海岸线沿直线布置了N个工兵营地,Derek和Tidy的任务就是要监视这些工兵营地的活动情况。由于采取了某种先进的监测手段,所以每个工兵营地的人数C国都掌握的一清二楚,每个工
阅读全文
摘要:Description In mathematics, the four color theorem, or the four color map theorem, states that, given any separation of a plane into contiguous region
阅读全文
摘要:Description Three Kingdoms is a funny game. Often Liu Bei is weak and has to run away,so in the game Liu Bei has a skill called "Dunzou". This time yo
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=1010 我认为的剪枝就是在本来的代码中加入一些附加条件使之不去进行多余的计算,防止超时 奇偶剪枝的知识链接 AC代码: 1 #include <iostream> 2 #include <cstdio>
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=3466 题目很容易理解,但是如何将其转换为01背包是个问题。 对物品按 qi-pi 的值从小到大排序,因为这样可以保证每次更新的状态值从小到大递增,前面更新过的状态不会影响后面更新的状态。 题目代码:
阅读全文
摘要:题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=2639 求第k优解的关键代码: 用两个数组记录两种状态(选择或不选择),并且只要记录前k次。在这两个数组中都是前k次可能的最优解。所以我们只要把这两个数组做比较,一直排到k就行了 题目代码: 1 #in
阅读全文

浙公网安备 33010602011771号