摘要: Adam and Eve enter this year's ACM International Collegiate Programming Contest. Last night, they played the Calendar Game, in celebration of this con 阅读全文
posted @ 2017-07-27 23:53 ISGuXing 阅读(207) 评论(0) 推荐(0) 编辑
摘要: 题目链接:https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1895 题目大意:类似于这道题UESTC - 1599 就是将所有的数字最后合并为一个数字,但是 阅读全文
posted @ 2017-07-27 23:46 ISGuXing 阅读(207) 评论(0) 推荐(0) 编辑
摘要: ps:转自http://blog.csdn.net/y990041769/article/details/20116995 大数加法模板(本人验证过,其他还没用,只是写在这) 大数乘法模版: 大数除法模板 浮点的N次方 字符串去除后导0函数,前导0可以先反转取后导。 大整数开方: 思路一:来源:ht 阅读全文
posted @ 2017-07-27 23:28 ISGuXing 阅读(465) 评论(0) 推荐(0) 编辑
摘要: LIS(最长上升子序列) 常规的解法就是动态规划。 mx[ j ]表示长度为j的上升子序列最小的值a[i]; dp[ i ]表示前i个数的最长上升子序列长度多少。 这就是解决LIS的核心代码,时间复杂度网上的博客说复杂度是O(n2) 说实话,个人感觉没有那么高的复杂度,比如HDU-5532就可以用这 阅读全文
posted @ 2017-07-27 00:40 ISGuXing 阅读(654) 评论(0) 推荐(0) 编辑
摘要: RMQ (Range Minimum/Maximum Query)问题是指:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j<=n),返回数列A中下标在i,j里的最小(大)值,也就是说,RMQ问题是指求区间最值的问题。 通常来说RMQ算法的实现有两种方法 1、线段树实现。这里不讲,可以 阅读全文
posted @ 2017-07-27 00:02 ISGuXing 阅读(246) 评论(0) 推荐(0) 编辑
摘要: 湫湫减肥 越减越肥! 最近,减肥失败的湫湫为发泄心中郁闷,在玩一个消灭免子的游戏。 游戏规则很简单,用箭杀死免子即可。 箭是一种消耗品,已知有M种不同类型的箭可以选择,并且每种箭都会对兔子造成伤害,对应的伤害值分别为Di(1 <= i <= M),每种箭需要一定的QQ币购买。 假设每种箭只能使用一次 阅读全文
posted @ 2017-07-26 23:38 ISGuXing 阅读(260) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-07-25 21:48 ISGuXing 阅读(350) 评论(0) 推荐(0) 编辑
摘要: 题目链接https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=666 题目大意: 输入一个n,求出所有abcde/fghij=n的情况。 思路:枚举所有情况。因为 阅读全文
posted @ 2017-07-25 21:16 ISGuXing 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2017-07-25 21:06 ISGuXing 阅读(186) 评论(0) 推荐(0) 编辑
摘要: Distance Queries Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 13987 Accepted: 4924 Case Time Limit: 1000MS Description Farmer John's cow 阅读全文
posted @ 2017-07-22 11:19 ISGuXing 阅读(188) 评论(0) 推荐(0) 编辑