07 2017 档案
摘要:C. The Meaningless Game time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Slastyona and her
阅读全文
摘要:B. The Festive Evening time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output B. The Festive Eve
阅读全文
摘要:A. The Useless Toy time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Walking through the st
阅读全文
摘要:题目大意:就是求最长的上升子序列,输出长度。 思路:LIS水题。就是题目描述的特别长。
阅读全文
摘要:题目大意:就是说怎样建道路才使得所建道路最多。任意两天道路不能交叉。 解题思路:因为是按城市按顺序排列。所以我们只需将两个城市序号用结构体存下来。对富人城市排序。 这样就成了一个序列了,这样就成了一个LIS的裸题了。 ps:1、这题目坑的地方在于输出的地方,讲究英语语法。。。如果一条路输出road,
阅读全文
摘要:Problem B 函数求解 Accept: 171 Submit: 540Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 171 Submit: 540Time Limit: 1000 mSec Memory Limit : 32768
阅读全文
摘要:Problem A 据说题目很水 Accept: 113 Submit: 445Time Limit: 1000 mSec Memory Limit : 32768 KB Accept: 113 Submit: 445Time Limit: 1000 mSec Memory Limit : 3276
阅读全文
摘要:不安全字符串 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 集训十分无聊,于是boss发明了一个“益智”游戏——假设有一段仅由U和L构成的字符串,我们定义当连续的U的个数大于等于三的时候,这个
阅读全文
摘要:涛神的城堡 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 涛神有一个城堡给游客参观,涛神特别的强壮,涛神的强壮值是strong,每个游客也有自己的强壮值,涛神为了赚钱,他会选取多个区间去打劫别
阅读全文
摘要:涛涛的Party Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 涛神因为极强,并且特别帅,所以拥有很多美女的联系方式,每个美女都有自己的食量以及魅力值,大家都知道,物以类聚,人以群分,朋友的朋
阅读全文
摘要:壮壮的数组 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description A,B,C为三个元素个数为n的数组,A={a1,a2,a3...an},B={b1,b2,b3...bn},C={c1,c2,c3..
阅读全文
摘要:最小的数 Font: Times New Roman | Verdana | Georgia Font Size: ← → Problem Description 定义一种正整数集合K,集合中有N个数,集合中元素Ki(1<=i<=N)是包含i个不同质因子的最小的数。因为Ki可能会很大,所以将集合中所
阅读全文
摘要:Nowadays, a kind of chess game called “Super Jumping! Jumping! Jumping!” is very popular in HDU. Maybe you are a good boy, and know little about this
阅读全文
摘要:Advanced Fruits Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 3622 Accepted Submission(s): 1872
阅读全文
摘要:1007 dada的GCD,输入格式描述有误,已修正 dada的GCD Time Limit : 3000/1000ms (Java/Other) Memory Limit : 65535/32768K (Java/Other) Total Submission(s) : 36 Accepted S
阅读全文
摘要:This is a problem from ZOJ 2432.To make it easyer,you just need output the length of the subsequence. InputEach sequence is described with M - its len
阅读全文
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=3755 题目大意: 意思不难理解,就是找到以某个字符串为前缀的最小的斐波拉契数列,并输出是第几个
阅读全文
摘要:Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this con
阅读全文
摘要:题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1895 题目大意:类似于这道题UESTC - 1599 就是将所有的数字最后合并为一个数字,但是
阅读全文
摘要:ps:转自http://blog.csdn.net/y990041769/article/details/20116995 大数加法模板(本人验证过,其他还没用,只是写在这) 大数乘法模版: 大数除法模板 浮点的N次方 字符串去除后导0函数,前导0可以先反转取后导。 大整数开方: 思路一:来源:ht
阅读全文
摘要:LIS(最长上升子序列) 常规的解法就是动态规划。 mx[ j ]表示长度为j的上升子序列最小的值a[i]; dp[ i ]表示前i个数的最长上升子序列长度多少。 这就是解决LIS的核心代码,时间复杂度网上的博客说复杂度是O(n2) 说实话,个人感觉没有那么高的复杂度,比如HDU-5532就可以用这
阅读全文
摘要:RMQ (Range Minimum/Maximum Query)问题是指:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j<=n),返回数列A中下标在i,j里的最小(大)值,也就是说,RMQ问题是指求区间最值的问题。 通常来说RMQ算法的实现有两种方法 1、线段树实现。这里不讲,可以
阅读全文
摘要:湫湫减肥 越减越肥! 最近,减肥失败的湫湫为发泄心中郁闷,在玩一个消灭免子的游戏。 游戏规则很简单,用箭杀死免子即可。 箭是一种消耗品,已知有M种不同类型的箭可以选择,并且每种箭都会对兔子造成伤害,对应的伤害值分别为Di(1 <= i <= M),每种箭需要一定的QQ币购买。 假设每种箭只能使用一次
阅读全文
摘要:C. Timofey and a tree time limit per test 2 seconds memory limit per test 256 megabytes input standard input output standard output C. Timofey and a t
阅读全文
摘要:题目链接https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=666 题目大意: 输入一个n,求出所有abcde/fghij=n的情况。 思路:枚举所有情况。因为
阅读全文
摘要:Bimokh is Mashmokh's boss. For the following n days he decided to pay to his workers in a new way. At the beginning of each day he will give each work
阅读全文
摘要:Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 13987 Accepted: 4924 Case Time Limit: 1000MS Description Farmer John's cow
阅读全文
摘要:There are n houses in the village and some bidirectional roads connecting them. Every day peole always like to ask like this "How far is it if I want
阅读全文
摘要:LCA ,也就是最近公共祖先是什么意思呢。 下面这张图可能会让你清楚的明白什么是最近公共祖先。 对于初始点,前提是它能构成一棵不成环的树,之所以不能成环,从定义就看出来了嘛,如果成环,是不是有种1是3的父亲,3是6的父亲,6又是1的父亲的感觉。O(∩_∩)O哈哈~ 那么我们又从上面一句话能看出另一个
阅读全文
摘要:树状数组和线段树的那些事 共同点:线段树,树状数组都是用来快速搜索。 线段树通过分支查找,树状数组通过用二进制快速查找,树状数组的查询和更新时间复杂度都是O(logN),通常来说,树状数组能做的线段树都能解决。线段树的范围更广。 但是树状数组的范围虽然小,但是执行效率却比线段树高了不少。 树状数组在
阅读全文
摘要:前几天听学长讲了背包,感觉有点难,于是慢慢琢磨,先是听学长分析,后来自己看崔添翼的背包问题九讲 2.0 beta 1.2 那个PDF,再结合网上的许多大牛写的背包讲解,还有就是题目的练习,终于有点体会了。 常见的几类背包问题 1、01背包 题目 有 N 件物品和一个容量为 V 的背包。放入第 i 件
阅读全文
摘要:Bone Collector II Time Limit: 5000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 4948 Accepted Submission(s): 25
阅读全文
摘要:Nowadays, we all know that Computer College is the biggest department in HDU. But, maybe you don't know that Computer College had ever been split into
阅读全文
摘要:The Fewest Coins Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 6615 Accepted: 2039 Description Farmer John has gone to town to buy some f
阅读全文
摘要:Coins Time Limit: 3000MS Memory Limit: 30000K Total Submissions: 37959 Accepted: 12882 Description People in Silverland use coins.They have coins of v
阅读全文
摘要:Dividing Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 71507 Accepted: 18648 Description Marsha and Bill own a collection of marbles. The
阅读全文
摘要:On January 1st 2002, The Netherlands, and several other European countries abandoned their national currency in favour of the Euro. This changed the e
阅读全文
摘要:最近xhd正在玩一款叫做FATE的游戏,为了得到极品装备,xhd在不停的杀怪做任务。久而久之xhd开始对杀怪产生的厌恶感,但又不得不通过杀怪来升完这最后一级。现在的问题是,xhd升掉最后一级还需n的经验值,xhd还留有m的忍耐度,每杀一个怪xhd会得到相应的经验,并减掉相应的忍耐度。当忍耐度降到0或
阅读全文
摘要:The trouble of Xiaoqian Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2277 Accepted Submission(
阅读全文
摘要:1101 换零钱 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 1101 换零钱 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算法题 1101 换零钱 基准时间限制:1 秒 空间限制:131072 KB 分值: 20 难度:3级算
阅读全文
摘要:有N种物品,每种物品的数量为C1,C2......Cn。从中任选若干件放在容量为W的背包里,每种物品的体积为W1,W2......Wn(Wi为整数),与之相对应的价值为P1,P2......Pn(Pi为整数)。求背包能够容纳的最大价值。 Input第1行,2个整数,N和W中间用空格隔开。N为物品的种
阅读全文
摘要:先判断是否大于等于5元,如果是就排序,找出最大的,对剩下的菜进行动态规划 饭卡 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 30534 Acc
阅读全文
摘要:还是入门题,只不过需要优化一下空间,不然就会内存超限 Bessie has gone to the mall's jewelry store and spies a charm bracelet. Of course, she'd like to fill it with the best char
阅读全文
摘要:01背包入门题,刚学完当写模板。 在N件物品取出若干件放在容量为W的背包里,每件物品的体积为W1,W2……Wn(Wi为整数),与之相对应的价值为P1,P2……Pn(Pi为整数)。求背包能够容纳的最大价值。 Input第1行,2个整数,N和W中间用空格隔开。N为物品的数量,W为背包的容量。(1 <=
阅读全文