摘要: 原题:poj3061 题意:给你一个数s,再给出一个数组,要求你从中选出m个连续的数,m越小越好,且这m个数之和不小于s 这是一个二分查找优化题,那么区间是什么呢?当然是从1到数组长度了。比如数组长度为10,你先找5,去枚举每一个区间为5的连续的数,发现存在这样的数,那么就可以继续往左找,反之则往右 阅读全文
posted @ 2015-08-05 19:14 江南何采莲 阅读(164) 评论(0) 推荐(0) 编辑
摘要: 原题:UVA11078 题意:给你一个数组,设a[],求一个m=a[i]-a[j],m越大越好,而且i必须小于j 怎么求?排序?要求i小于j呢。枚举?只能说超时无上限。所以遍历一遍数组,设第一个被减数为a【0】,之后遇到比a【0】大的数就更新它,再拿这个被减数去减数组中的每一个元素,同时也要不断地更 阅读全文
posted @ 2015-08-05 18:58 江南何采莲 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Description John Doe is a famous DJ and, therefore, has the problem of optimizing the placement of songs on his tapes. For a given tape and for each s 阅读全文
posted @ 2015-08-05 18:41 江南何采莲 阅读(202) 评论(0) 推荐(0) 编辑
摘要: UVA 11572 唯一的雪花 题意:给你从1到n的数组,要求求得其中的最长连续不重复子序列,经典的滑窗问题,方法是维护一个窗口,设置左框和右框,然后不断的进行维护和更新 方法一: #include"iostream" #include"set" #include"cstring" #include 阅读全文
posted @ 2015-08-05 17:23 江南何采莲 阅读(350) 评论(0) 推荐(0) 编辑
摘要: Description The SUM problem can be formulated as follows: given four lists A, B, C, D<tex2html_verbatim_mark> of integer values, compute how many quad 阅读全文
posted @ 2015-08-05 17:06 江南何采莲 阅读(242) 评论(0) 推荐(0) 编辑
摘要: Description Shaass has n books. He wants to make a bookshelf for all his books. He wants the bookshelf's dimensions to be as small as possible. The th 阅读全文
posted @ 2015-08-05 17:01 江南何采莲 阅读(313) 评论(0) 推荐(0) 编辑
摘要: Description Most financial institutions had become insolvent during financial crisis and went bankrupt or were bought by larger institutions, usually 阅读全文
posted @ 2015-08-05 16:45 江南何采莲 阅读(259) 评论(0) 推荐(0) 编辑
摘要: G - 贪心 Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit Status G - 贪心 Submit Status Description Simon and Garfunkel Corporation ( 阅读全文
posted @ 2015-08-05 16:20 江南何采莲 阅读(357) 评论(0) 推荐(1) 编辑
摘要: Description A set of n<tex2html_verbatim_mark> 1-dimensional items have to be packed in identical bins. All bins have exactly the same length l<tex2ht 阅读全文
posted @ 2015-08-05 15:56 江南何采莲 阅读(174) 评论(0) 推荐(0) 编辑
摘要: UVA10382 :http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=21419 只能说这道题和D题是一模一样的,不过要进行转化,这道题有一道坑,方法一需要使用scanf()输入,还需判断输入的正确性,即scanf()==3。。。 阅读全文
posted @ 2015-08-05 15:47 江南何采莲 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 原题 UVA10020 :http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=19688 经典的贪心问题,区间上贪心当然是右区间越右越好了,当然做区间要小于等于当前待覆盖的位置,我们可以用一个变量begin代表当前待覆盖的区间的左值 阅读全文
posted @ 2015-08-05 15:39 江南何采莲 阅读(478) 评论(0) 推荐(0) 编辑
摘要: Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6639 Accepted Submission(s): 2514 Problem Descrip 阅读全文
posted @ 2015-08-05 14:59 江南何采莲 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 恢复内容开始 Description Before the invention of book-printing, it was very hard to make a copy of a book. All the contents had to be re-written by hand by 阅读全文
posted @ 2015-08-05 11:41 江南何采莲 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 原题poj 2299:http://poj.org/problem?id=2299 题意,给你一个数组,去统计它们的逆序数,由于题目中说道数组最长可达五十万,那么O(n^2)的排序算法就不要再想了,归并排序~~~ 这里列出归并的解法: #include <iostream> #include <cs 阅读全文
posted @ 2015-08-05 11:11 江南何采莲 阅读(331) 评论(0) 推荐(0) 编辑