随笔分类 - DP
动态规划
摘要:Another OCD PatientTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 131072/131072 K (Java/Others)Total Submission(s): 645 Accepted Submission(s): 238 Problem Description Xiaoji is an OCD (ob...
阅读全文
摘要:Tunnels Time Limit: 3000/1500 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 844 Accepted Submission(s): 249 Problem
阅读全文
摘要:Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3075 Accepted Submission(s): 1561 Proble
阅读全文
摘要:滑雪 Time Limit: 1000MSMemory Limit: 65536K Total Submissions: 74624Accepted: 27644 Description Michael喜欢滑雪百这并不奇怪, 因为滑雪的确很刺激。可是为了获得速度,滑的区域必须向下倾斜,而且当你滑到坡底,你不得不再次走上坡或者等待升降机来载你。Michael想知道载一个区域中最长底滑坡。区域由一个二...
阅读全文
摘要:Play GameTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65535/65535 K (Java/Others)Total Submission(s): 630Accepted Submission(s): 374Problem Des...
阅读全文
摘要:Palindrome subsequenceTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65535 K (Java/Others)Total Submission(s): 2232Accepted Submis...
阅读全文
摘要:6073 Math MagicYesterday, my teacher taught us about math: +, -, *, /, GCD, LCM... As you know, LCM (Leastcommon multiple) of t...
阅读全文
摘要:ChessTime Limit: 6000/3000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 193Accepted Submission(s): 59Problem Descript...
阅读全文
摘要:题目中叫求一个最大的区域,则第i个矩形对应的面积是ave[i] = (r[i] – l[i] + 1) * a[i];l[i]表示以它这个高度所能到达的最左边的位置(最左一个高度不小于它的高度的位置),而r[i]表示能到达的最右边的位置(最右一个高度不小于它的高度的位置)。 那么这个题目就转到怎么求r[]和l[]上了。如果每次依次向左向右找,肯定会超时的。这时就会用到迭代了,比如说求...
阅读全文
摘要:The more, The Better Time Limit: 6000/2000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 4859 Accepted Submission(s): 2864 Problem Description ACboy很喜欢玩...
阅读全文
摘要:Ignatius and the Princess IIITime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem Description"Well, it seems the first problem is too easy. I will let you know how foolish you are later." feng5166 says. "The second problem is, given an positive inte
阅读全文
摘要:9513 防空洞时间限制:1000MS 内存限制:65535K题型: 编程题 语言: 无限制Description 有一天,dragon123偷偷地拿锄头在学校里挖开了一个尘封已久的防空洞。 他在这个防空洞里面找到许多贵重的东西:一些石头和一些液体。 dragon123知道,只要他把这些石头和液体拿出去卖,那么就一定可以赚大钱。但是,他只有一个载重量为W的瓶子来装这些东西。 防空洞里面有很多块石头,每块石头的重量为Wi,价值为Mi,但是石头不能够砸烂,否则就不值钱了。 此外,洞里面很多种贵重的液体。对于某种液体,洞内存储了Wi重量,且这Wi重量液体的总价值为Mi。...
阅读全文
摘要:Square CoinsTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem DescriptionPeople in Silverland use square coins. Not only they have square shapes but also their values are square numbers. Coins with values of all square numbers up to 289 (=17^2), i.e., 1-credit
阅读全文
摘要:To the MaxTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 38573Accepted: 20350DescriptionGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1*1 or greater located within the whole array. The sum of a rectangle is the sum of a
阅读全文
摘要:permutationTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 141 Accepted Submission(s): 81 Problem DescriptionPermutation plays a very important role in Combinatorics. For example ,1 2 3 4 5 and 1 3 5 4 2 are both 5-permutations. As everyone's
阅读全文
摘要:Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Problem DescriptionGiven a sequence a[1],a[2],a[3]......a[n], your job is to calculate the max sum of a sub-sequence. For example, given (6,-1,5,4,-7), the max sum in this sequence is 6 + (-1) + 5 + 4 = 14.InputT
阅读全文
摘要:10901 Missile时间限制:1000MS 内存限制:65535K提交次数:40 通过次数:7DescriptionLong, long ago, country A invented a missile system to destroy the missiles from their enemy. That system can launch only one missile to destroy multiple missiles if the heights of all the missiles form a non-decrease sequence.But recently
阅读全文
摘要:8633 回文划分时间限制:1000MS 内存限制:1000K题型: 编程题 语言: 无限制Description 我们说一个字符串是回文串,那么意味着这个串从两边读起来的字母都是一样的。例如racecar是回文串,然而fastcar则不是。 对一个串的划分意思是将一个串划分为若干个部分...
阅读全文

浙公网安备 33010602011771号