
joj acm_动态规划
kongming_acm
kongming_acm
展开
-
2162: Inuyasha And the Monsters
<br /> 2162: Inuyasha And the MonstersResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE5s8192K573184StandardInuyasha and Kagome, do you hear of them?<br />Now, they want to kill a great many of monsters. Those monsters hide in several palaces. The palac原创 2010-07-10 20:56:00 · 484 阅读 · 0 评论 -
1424: Coin Change
<br />1424: Coin ChangeResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K528166Standard<br />Suppose there are 5 types of coins: 50-cent, 25-cent, 10-cent, 5-cent, and 1-cent. We want to make changes with these coins for a given amount of money. <br原创 2010-07-10 20:52:00 · 837 阅读 · 4 评论 -
1968: Common Subsequence
<br />1968: Common SubsequenceResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s4096K607187Standard<br />A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., xm > another原创 2010-07-10 20:53:00 · 511 阅读 · 0 评论 -
1995: Energy
<br /> 1995: EnergyResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s10240K1093298Standard<br />Mr. Jojer is a very famous chemist. He is doing a research about behavior of a group of atoms. Atoms may have different energy and energy can be positive or n原创 2010-07-10 20:54:00 · 844 阅读 · 0 评论 -
2201: Prime and Decompounding
<br />2201: Prime and DecompoundingResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K308165StandardA positive interger except 1 can be decompounded to the sum of several prime numbers(include only one number). For exsample, four of the different for原创 2010-07-10 20:57:00 · 496 阅读 · 0 评论 -
2240: Dragon's Collection 二维背包
<br />2240: Dragon's CollectionResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE5s8192K355130Standard<br />Arthur最终打败了Dragon, 获得了Dragon的所有收集品. 但不幸的是, 他的背包容量有限, 并且他的负重也有限. 因此他只能在不超过背包总容量和总重量限制的前提下选择最有价值的物品. Input:<br />本题目包括多个Case。每个Case的第一行有3个数字, 依次是物品的个数原创 2010-07-21 07:54:00 · 459 阅读 · 0 评论 -
joj 1279 最长上升子序列 NLogN
<br />#include<iostream><br />#include<cstdlib><br />using namespace std;<br />int a[10005],dp[10005],ord[1005];<br />int main()<br />{<br /> int n=1;<br /> while(cin>>a[n]) n++;n--;<br /> int len=0,maxn=0;<br /> for(int i=1;i<=n;i++)<br />原创 2010-07-23 23:32:00 · 641 阅读 · 0 评论 -
1048: Wooden Sticks
<br />#include<iostream><br />#include<cstdio><br />#include<algorithm><br />using namespace std;<br />struct Node<br />{<br /> int len;<br /> int wei;<br />};<br />Node a[21000];<br />int f[210000];<br />bool cmp(Node x,Node y)<br />{<br /> if(x.原创 2010-08-27 18:42:00 · 466 阅读 · 0 评论 -
1028: Dividing Up 多重背包解决一堆数中任取几个数能否组成m的问题
<br /> 1028: Dividing UpResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE10s8192K2055420StandardMarsha and Bill own a collection of marbles. They want to split the collection among themselves so that both receive an equal share of the marbles. This would原创 2010-10-31 10:25:00 · 655 阅读 · 0 评论 -
1832: Little Shop of Flowers
<br /> 1832: Little Shop of FlowersResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K301124Standard<br />You want to arrang原创 2010-09-08 14:54:00 · 709 阅读 · 2 评论 -
2421: Margaritas on the River Walk 给定n件物品和一个背包,第i件物品的体积为Vi,背包容量为C.要求吧一些物品放入背包使得剩下的物品都放不下去,求方案数
2421: Margaritas on the River WalkResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s8192K14543StandardOne of the more popular activities i原创 2011-03-23 22:42:00 · 1261 阅读 · 0 评论 -
joj 3760 JLUCPC 树状DP
#include#include#include#includeusing namespace std;const int maxn=210000;struct Node{ int t,w; int next;};int p[maxn];Node G[maxn];in原创 2011-07-29 14:12:28 · 513 阅读 · 0 评论 -
joj 2344: Dissolution of Integer 将N分解成乘积形式 共有多少种解法
As you known,a positive integer can be written to a form of products of several positive integers(N = x1 * x2 * x3 *.....* xm (xi!=1 (1<=i<=原创 2011-10-04 12:05:05 · 702 阅读 · 0 评论 -
joj 2620: Count Square 状态压缩DP N*M的0,1方格,每一个2*2的小方格有一个价值,求整个方格的最大价值
Xiaoming is a 5-year old boy. He has many toys. Among them there is a magic box. On the top of the box there are n * m grids. One can color原创 2011-10-18 20:54:18 · 973 阅读 · 0 评论 -
1263: What Goes Up
<br />1263: What Goes UpResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K896219Standard<br />Write a program that will select the longest strictly increasing subsequence from a sequence of integers. Input<br />The input file will contain a sequence原创 2010-07-10 20:51:00 · 594 阅读 · 0 评论 -
1129: Divisibility
<br />1129: DivisibilityResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1155290Standard<br />Consider an arbitrary sequence of integers. One can place + or - operators between integers in the sequence, thus deriving different arithmetical expressi原创 2010-07-10 20:49:00 · 318 阅读 · 0 评论 -
2285: Decompose
<br />2285: DecomposeResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K267149StandardGive you an positive integer N(1<=N<=30), you can decompose n to several positive integers: A1, A2, ... Ak. (1<=k<=N) And A1 + A2 + ... + Ak = N. Now i want to know原创 2010-07-10 20:58:00 · 610 阅读 · 0 评论 -
2650: 礼物
<br />2650: 礼物ResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K15326Standard<br />10*10的格子(1,1)-(10,10)。一个人开始(0秒)站在(1,1)点。每秒他最多可以移动v个格子(但是只能是上下左右,不可以斜着移动)。每一秒钟,天空中会有礼物落下来。当这个人这一秒移动结束后停在某一个格子中,他就可以得到这一秒落到这个格子里的所有礼物。时间一共有t秒。由于礼物的价值是不同的。他想让收集到的礼物价值和最大原创 2010-07-10 21:09:00 · 478 阅读 · 0 评论 -
2684: Problem J
<br />#include<iostream><br />using namespace std;<br />int a[100009];<br />int main()<br />{<br /> int n;<br /> while(scanf("%d",&n)&&n)<br /> {<br /> for(int i=0;i<n;i++) scanf("%d",&a[i]);<br /> int max=-1,s=-1;<br /> for(i原创 2010-07-10 21:10:00 · 416 阅读 · 0 评论 -
1653: Testing the CATCHER
<br />1653: Testing the CATCHERResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K416101Standard<br />A military contractor for the Department of Defense has just completed a series of preliminary tests for a new defensive missile called the CATCHER原创 2010-07-10 20:52:00 · 524 阅读 · 0 评论 -
1829: Candies
<br />1829: CandiesResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K816179Standard<br />All children like candies. One day a group of children are dividing M candies by the following rules. <br />1. The candies are numbered with 1,2,3…M. <br />2. O原创 2010-07-10 20:53:00 · 513 阅读 · 0 评论 -
2058: Find the Section
<br />2058: Find the SectionResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K569128StandardIn this task you are asked to deal with a lot of floating point numbers. Find the section in a number table that the sum of the numbers in it is the maximum.原创 2010-07-10 20:55:00 · 451 阅读 · 0 评论 -
2216: Ski
<br />2216: SkiResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE8s8192K853216Special Test<br />It is well-known that in the game of ski sportsmen slide from a higher position to a lower one, and they always desist when all the abutting (up, down, left, an原创 2010-07-10 20:57:00 · 611 阅读 · 0 评论 -
2350: A Emphasized Character
<br />2350: A Emphasized CharacterResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K20673Standard<br />In Tom's telephone book, persons is order by their essentiality but not their dictionary order. He is annoyed that he can't find one item quickly.原创 2010-07-10 21:00:00 · 575 阅读 · 0 评论 -
2486: Stock Wave
<br />2486: Stock WaveResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s32768K1208188Standard<br />As a stock analyst, Tom can forecast the trend according to a series of historical prices. To find the "Wave" is the first thing that he needs to do.<br />原创 2010-07-10 21:05:00 · 499 阅读 · 0 评论 -
2521: Monkey and fruits
<br />2521: Monkey and fruitsResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K36562StandardAfter culling his most favorite fruits from the trees in an orchard,Keen AS, a mischievous monkey, is confused of the way in which he can combine these piles原创 2010-07-10 21:06:00 · 461 阅读 · 0 评论 -
2529: Chorus
<br /> 2529: ChorusResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s16384K436122Standard<br />N位同学站成一排,音乐老师要请其中的(N-K)位同学出列,使得剩下的K位同学排成合唱队形。 合唱队形是指这样的一种队形:设K位同学从左到右依次编号为1,2…,K,他们的身高分别为T1,T2,…,TK, 则他们的身高满足T1<...Ti+1>…>TK(1<=i<=K)。 你的任务是,已知所有N位同学的原创 2010-07-10 21:07:00 · 619 阅读 · 0 评论 -
2526: medic
<br />2526: medicResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE1s16384K551143Standard<br />辰辰是个天资聪颖的孩子,他的梦想是成为世界上最伟大的医师。为此,他想拜附近最有威望的医师为师。医师为了判断他的资质,给他出了一个难题。医师把他带到一个到处都是草药的山洞里对他说:“孩子,这个山洞里有一些不同的草药,采每一株都需要一些时间,每一株也有它自身的价值。我会给你一段时间,在这段时间里,你可以采到一些草药。如果你是原创 2010-07-10 20:48:00 · 464 阅读 · 0 评论 -
1092: To the Max 最大子矩阵
<br />1092: To the MaxResultTIME LimitMEMORY LimitRun TimesAC TimesJUDGE3s8192K1256268StandardGiven a two-dimensional array of positive and negative integers, a sub-rectangle is any contiguous sub-array of size 1 x 1 or greater located within the whole arr原创 2010-07-10 20:48:00 · 526 阅读 · 0 评论 -
joj 2262: Brackets 最多有多少括号匹配
We give the following inductive definition of a " regular brackets " sequence:the empty sequence is a regular brackets sequence, if s is a regular brackets sequence, then (s) and [s] are regular b原创 2011-10-19 23:40:38 · 768 阅读 · 0 评论