随笔分类 - 动态规划 递推
摘要:Energetic PandasThere arenbamboos of different weightsWi. There arenpandas of different capacityCAPi. How many ways the pandas can carry t...
阅读全文
摘要:Partial TreeProblem DescriptionIn mathematics, and more specifically in graph theory, a tree is an undirected graph in which any two nodes are connect...
阅读全文
摘要:D. KindergartenIn a kindergarten, the children are being divided into groups. The teacher put the children in a line and associated each child with hi...
阅读全文
摘要:BZOJ 1026: [SCOI2009]windy数:题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1026 dp[11][11][2]:dep,pre,f 要求的性质就是相邻数字差至少是2。 递归函数的状态设计如下...
阅读全文
摘要:Removed IntervalProblem DescriptionGiven a sequence of numbers A=a1,a2,…,aN, a subsequence b1,b2,…,bk of A is referred as increasing if b1using namesp...
阅读全文
摘要:E. LIS of SequenceThe next "Data Structures and Algorithms" lesson will be about Longest Increasing Subsequence (LIS for short) of a sequence. For bet...
阅读全文
摘要:D. Valid SetsAs you know, an undirected connected graph withnnodes andn - 1edges is called atree. You are given an integerdand a tree consisting ofnno...
阅读全文
摘要:Lie问题描述一个年级总共有N个学生,每个人属于唯一一个班级。现在他们站在一排,同班同学并不一定会站在一起,但每个人都会说一句话:“站在我左边的有Ai个同班同学,右边有Bi个同班同学”。然而并不是每个人都会说真话,老师也忘了他们说话的顺序,现在老师想知道最多有多少人的话同时不矛盾。输入描述输入有多组...
阅读全文
摘要:D. FlowersWe saw the little game Marmot made for Mole's lunch. Now it's Marmot's dinner time and, as we all know, Marmot eats flowers. At every dinner...
阅读全文
摘要:D. Red-Green TowersThere arerred andggreen blocks for construction of thered-greentower.Red-greentower can be built following next rules:Red-green tow...
阅读全文
摘要:D - Pick The SticksDescriptionThe story happened long long ago. One day, Cao Cao made a special order called "Chicken Rib" to his army. No one got his...
阅读全文
摘要:C - The Battle of ChibiDescriptionCao Cao made up a big army and was going to invade the whole South China. Yu Zhou was worried about it. He thought t...
阅读全文
摘要:Dice (I)You haveNdices; each of them hasKfaces numbered from1toK. Now you have arranged theNdices in a line. You can rotate/flip any dice if you want....
阅读全文
摘要:The Highest Mark问题描述2045年的SD省队选拔,赛制和三十年前已是完全不同。一场比赛的比赛时间有 tt 分钟,有 nn 道题目。第 ii 道题目的初始分值为 A_i(A_i \leq 10^{6})Ai(Ai≤106) 分,...
阅读全文
摘要:D. Once Again...You are given an array of positive integersa1, a2, ..., an × Tof lengthn × T. We know that for ...
阅读全文
摘要:D. Painting The WallUser ainta decided to paint a wall. The wall consists ofn2tiles, that are arranged in ann ×...
阅读全文
摘要:Clarke and problem问题描述克拉克是一名人格分裂患者。某一天,克拉克分裂成了一个学生,在做题。 突然一道难题难到了克拉克,这道题是这样的: 给你nn个数,要求选一些数(可以不选),把它们加起来,使得和恰好是pp的倍数(00也是pp的倍数),求方案...
阅读全文
摘要:Aeroplane chess Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem Description...
阅读全文
摘要:1037: [ZJOI2008]生日聚会PartyTime Limit:10 SecMemory Limit:162 MBSubmit:1650Solved:971[Submit][Status][Discuss]Description今天是hidadz小朋友的生日,她邀请了许多朋友来参加她的生日p...
阅读全文
摘要:B. Mashmokh and ACM time limit per test ...
阅读全文