E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
ACM_动态规划DP
选择陪审员 POJ1015 Jury Compromise
动态规划DP
搜索DFS 贪心
感觉比较难的一题,即使做第三遍也感觉比较吃力。题目描述很清楚,英文理解无障碍。此题实质:n个物体中选m个。 最容易想到的当然是搜索,即DFS。从1到n依次进行扫描,判断是否被选中。每选够m个,就与前面的结果进行一次比较。因为Max(n)=200,Max(m)=20所以搜索次数大致有,这样的规模应该比较恐怖。因此,如果不优化,暴搜必挂无疑。如何剪枝?也就是哪些状态不用搜索,
sj13051180
·
2011-07-20 11:00
最长公共子序列-
动态规划DP
因为比较有用,所以就转来了,原文地址http://www.nocow.cn/index.php/%E6%9C%80%E9%95%BF%E5%85%AC%E5%85%B1%E5%AD%90%E5%BA%8F%E5%88%97概述最长公共子序列:字符序列的子序列是指从给定字符序列中随意地(不一定连续)去掉若干个字符(可能一个也不去掉)后所形成的字符序列。令给定的字符序列X="x0,x1,...,xm-
Ping_QC
·
2011-04-14 02:00
c
优化
POJ 2250 Compromise 最长公共子序列LCS
动态规划DP
id=2250 最长公共子序列LCS
动态规划DP
Compromise Time Limit:1000MS Memory Limit:65536K
soboer
·
2011-01-05 14:00
Promise
POJ 2250 Compromise 最长公共子序列LCS
动态规划DP
id=2250 最长公共子序列LCS
动态规划DP
Compromise Time Limit:1000MS Memory Limit:65536K
thecloud
·
2011-01-05 14:00
Promise
POJ 2250 Compromise 最长公共子序列LCS
动态规划DP
id=2250最长公共子序列LCS
动态规划DP
CompromiseTimeLimit: 1000MS MemoryLimit: 65536KSpecialJudgeDescriptionInafewmonthstheEuropeanCurrencyUnionwillbecomeareality.However
yming0221
·
2011-01-05 14:00
POJ 1579 Function Run Fun 记忆化递归
本题使用记忆话递归即可,也可以用
动态规划DP
不过得使用三维数组,空间复杂度比较高 Function Run Fun Time Limit:1000MS Memory
thecloud
·
2010-12-15 21:00
function
POJ 1579 Function Run Fun 记忆化递归
本题使用记忆话递归即可,也可以用
动态规划DP
不过得使用三维数组,空间复杂度比较高 Function Run Fun Time Limit:1000MS Memory
soboer
·
2010-12-15 21:00
function
POJ 2181Jumping Cows
动态规划DP
Jumping Cows Time Limit:1000MS Memory Limit:65536K Total Submissions:4477 Accepted:2705 Description Farmer John's cows would like to jump over the moon, just like the cows in
thecloud
·
2010-12-09 11:00
动态规划
POJ 2181Jumping Cows
动态规划DP
Jumping Cows Time Limit:1000MS Memory Limit:65536K Total Submissions:4477 Accepted:2705 Description Farmer John's cows would like to jump over the moon, just like the cows in
soboer
·
2010-12-09 11:00
动态规划
01背包问题(
动态规划DP
)
#includeusingnamespacestd;intc[10][100];/*行代表是覆盖的背包个数,而列代表背包容量*/intKnapsack(intn,intm){inti,j;intw[10],v[10];/*分别代表各个物品的重量和价值*/for(i=1;iusingnamespacestd;intc[10][100];/*行代表是覆盖的背包个数,而列代表背包容量*/intx[10]
chenwenshi
·
2010-11-26 18:00
c
测试
input
zoj2744_Palindromes
首先说下DP方法,其实碰到这种具有很多重复计算的子问题的问题,很容易想到
动态规划DP
。对于这个问题可以这样理解:每次都从下标0开始搜索长度依次为2、3
blueslee
·
2010-10-13 11:00
HDU3646Fate Stay Night
动态规划DP
题解
FateStayNightTimeLimit:10000/5000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):278 AcceptedSubmission(s):73ProblemDescriptionJackwasaddictedtoafightinggamerecently.Theg
power721
·
2010-09-20 15:00
POJ2411Mondriaan's Dream题解
动态规划DP
Mondriaan'sDreamTimeLimit:3000MS MemoryLimit:65536KTotalSubmissions:4978 Accepted:2873DescriptionSquaresandrectanglesfascinatedthefamousDutchpainterPietMondriaan.Onenight,afterproducingthedrawingsinhi
power721
·
2010-09-16 19:00
Integer
input
each
output
2010
Numbers
POJ3254Corn Fields题解
动态规划DP
CornFieldsTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:2263 Accepted:1131DescriptionFarmerJohnhaspurchasedalushnewrectangularpasturecomposedofMbyN(1≤M≤12;1≤N≤12)squareparcels.Hewantstogrowsomey
power721
·
2010-09-16 17:00
POJ3073Spam题解
动态规划DP
SpamTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:835 Accepted:470DescriptionTothwartcontent-basedspamfilters,spammersoftenmodifythetextofaspamemailtopreventitsrecognitionbyautomaticfilteringpro
power721
·
2010-09-08 22:00
POJ1036Gangsters题解
动态规划DP
GangstersTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:5690 Accepted:1605DescriptionNgangstersaregoingtoarestaurant.Thei-thgangstercomesatthetimeTiandhastheprosperityPi.Thedooroftherestauranthas
power721
·
2010-09-08 17:00
POJ3280*Cheapest Palindrome题解
动态规划DP
CheapestPalindromeTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:2620 Accepted:1294DescriptionKeepingtrackofallthecowscanbeatrickytasksoFarmerJohnhasinstalledasystemtoautomateit.Hehasinstalledone
power721
·
2010-09-04 11:00
POJ2229Sumsets题解
动态规划DP
SumsetsTimeLimit:2000MS MemoryLimit:200000KTotalSubmissions:7686 Accepted:3059DescriptionFarmerJohncommandedhiscowstosearchfordifferentsetsofnumbersthatsumtoagivennumber.Thecowsuseonlynumbersthatarean
power721
·
2010-09-03 14:00
环形m段最大子段和 题解
动态规划DP
http://acm.hunnu.edu.cn/online/?action=problem&type=show&id=10581 环形m段最大子段和TimeLimit:5000ms,SpecialTimeLimit:15000ms,MemoryLimit:65536KBTotalsubmitusers:3,Acceptedusers:3Problem10581:Nospecialjudgemen
power721
·
2010-09-02 20:00
POJ3661Running题解
动态规划DP
RunningTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:3129 Accepted:1073DescriptionThecowsaretryingtobecomebetterathletes,soBessieisrunningonatrackforexactlyN(1≤N≤10,000)minutes.Duringeachminute,
power721
·
2010-08-26 20:00
REST
Integer
ini
each
output
distance
POJ1252Euro Efficiency题解
动态规划DP
EuroEfficiencyTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:1523 Accepted:710DescriptionOnJanuary1st2002,TheNetherlands,andseveralotherEuropeancountriesabandonedtheirnationalcurrencyinfavourofth
power721
·
2010-08-26 17:00
POJ1837Balance题解
动态规划DP
BalanceTimeLimit:1000MS MemoryLimit:30000KTotalSubmissions:3981 Accepted:2300DescriptionGigelhasastrange"balance"andhewantstopoiseit.Actually,thedeviceisdifferentfromanyotherordinarybalance.Itorderstw
power721
·
2010-08-26 15:00
POJ3342Party at Hali-Bula题解
动态规划DP
PartyatHali-BulaTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:2676 Accepted:994DescriptionDearContestant,I'mgoingtohaveapartyatmyvillaatHali-BulatocelebratemyretirementfromBCM.IwishIcouldinvitea
power721
·
2010-08-23 23:00
POJ2342Anniversary party题解
动态规划DP
AnniversarypartyTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:1507 Accepted:782DescriptionThereisgoingtobeapartytocelebratethe80-thAnniversaryoftheUralStateUniversity.TheUniversityhasahierarchic
power721
·
2010-08-23 21:00
POJ1260Pearls题解
动态规划DP
PearlsTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:3396 Accepted:1597DescriptionInPearlaniaeverybodyisfondofpearls.Onecompany,calledTheRoyalPearl,producesalotofjewelrywithpearlsinit.TheRoyalPea
power721
·
2010-08-23 21:00
POJ3666Making the Grade题解
动态规划DP
MakingtheGradeTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:1977 Accepted:912DescriptionAstraightdirtroadconnectstwofieldsonFJ'sfarm,butitchangeselevationmorethanFJwouldlike.Hiscowsdonotmindclim
power721
·
2010-08-23 13:00
POJ3260The Fewest Coins题解
动态规划DP
TheFewestCoinsTimeLimit:2000MS MemoryLimit:65536KTotalSubmissions:1677 Accepted:444DescriptionFarmerJohnhasgonetotowntobuysomefarmsupplies.Beingaveryefficientman,healwayspaysforhisgoodsinsuchawaythatt
power721
·
2010-08-23 12:00
c
Integer
System
input
output
payment
POJ3616Milking Time题解
动态规划DP
MilkingTimeTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:2159 Accepted:890DescriptionBessieissuchahard-workingcow.Infact,sheissofocusedonmaximizingherproductivitythatshedecidestoschedulehernextN
power721
·
2010-08-20 21:00
POJ3211Washing Clothes题解
动态规划DP
WashingClothesTimeLimit:1000MS MemoryLimit:131072KTotalSubmissions:5459 Accepted:1417DescriptionDearboywassobusyrecentlythatnowhehaspilesofclothestowash.Luckily,hehasabeautifulandhard-workinggirlfrien
power721
·
2010-08-20 20:00
POJ2626Chess题解
动态规划DP
ChessTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:1985 Accepted:870DescriptionTheAssociationofChessMonsters(ACM)isplanningtheirannualteammatchupagainsttherestoftheworld.Thematchwillbeon30boards
power721
·
2010-08-20 19:00
POJ3612Telephone Wire题解
动态规划DP
TelephoneWireTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:1735 Accepted:596DescriptionFarmerJohn'scowsaregettingrestlessabouttheirpoortelephoneservice;theywantFJtoreplacetheoldtelephonewirewith
power721
·
2010-08-20 17:00
POJ1923Fourier's Lines题解
动态规划DP
Fourier'sLinesTimeLimit:1000MS MemoryLimit:30000KTotalSubmissions:2144 Accepted:637DescriptionJosephFourierwasagreatmathematicianandphysicistandiswellknownforhismathematicseries.Amongallthenineteenchi
power721
·
2010-08-20 15:00
c
equals
input
UP
each
POJ2465Adventures in Moving - Part IV题解
动态规划DP
AdventuresinMoving-PartIVTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:1969 Accepted:668DescriptionTohelpyoumovefromWaterlootothebigcity,youareconsideringrentingamovingtruck.Gaspricesbeingsohigh
power721
·
2010-08-20 13:00
POJ3056The Bavarian Beer Party题解
动态规划DP
TheBavarianBeerPartyTimeLimit:6000MS MemoryLimit:65536KTotalSubmissions:750 Accepted:253DescriptionTheprofessorsoftheBayerischeMathematikerVereinhavetheirannualpartyinthelocalBiergarten.Theyaresitting
power721
·
2010-08-20 13:00
Algorithm
table
input
each
output
HDU3449Consumer题解
动态规划DP
ConsumerTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/65536K(Java/Others)TotalSubmission(s):174 AcceptedSubmission(s):92ProblemDescriptionFJisgoingtodosomeshopping,andbeforethat,heneedsso
power721
·
2010-08-19 21:00
游戏
c
each
output
Training
Numbers
SOJ2113: 数字游戏题解
动态规划DP
2113:数字游戏Submityoursolution Discussthisproblem Bestsolutions Description【问题描述】丁丁最近沉迷于一个数字游戏之中。这个游戏看似简单,但丁丁在研究了许多天之后却发觉原来在简单的规则下想要赢得这个游戏并不那么容易。游戏是这样的,在你面前有一圈整数(一共n个),你要按顺序将其分为m个部分,各部分内的数字相加,相加所得的m个
power721
·
2010-08-19 13:00
游戏
input
output
2010 ACM-ICPC Multi-University Training Contest(5)HDU3485Count 101题解
动态规划DP
Count101TimeLimit:2000/1000MS(Java/Others) MemoryLimit:65536/32768K(Java/Others)TotalSubmission(s):400 AcceptedSubmission(s):219ProblemDescriptionYouknowYaoYaoisfondofhischains.Hehasalotofchains
power721
·
2010-08-18 12:00
SOJ2818: QQ音速题解
动态规划DP
2818:QQ音速Submityoursolution Discussthisproblem Bestsolutions Description 最近flymouse开始玩qq音速,这个游戏只需要按4个键,上,下,左,右(分别用u,d,l,r表示)。 flymouse必须按照游戏规则,依次按下一系列键。问题是flymouse的手太胖了,他只能把两个手指放在方向键上。 flymo
power721
·
2010-08-17 22:00
游戏
qq
测试
input
output
JLU2686awake点兵题解
动态规划DP
http://acm.jlu.edu.cn/joj/showproblem.php?pid=2686awake点兵题目描述大战在即,awake将军招募了n名士兵,但是俗语云“兵多非益”,于是awake将军决定从这n名士兵中选择m个人组成一个兵团。每个人都有两个属性,一个是战斗力vi,另一个是相性wi,我们规定,任意两人的相性之差|wi-‐wj|为此二人的相性差。相性差越大,二人便会越合不来。aw
power721
·
2010-08-17 20:00
题解
动态规划DP
3732:I'mAttackingtheDarkness! Submityoursolution Discussthisproblem Bestsolutions TimeLimit:3000MSMemoryLimit:65536K Description Manytabletoprole-playinggames(RPGs),suchasaratherfam
power721
·
2010-08-16 13:00
Integer
Random
input
character
each
output
HDU2386Dart Challenge题解
动态规划DP
DartChallengeTimeLimit:4000/2000MS(Java/Others) MemoryLimit:32768/32768K(Java/Others)TotalSubmission(s):268 AcceptedSubmission(s):134ProblemDescriptionClarkandHarryaresiblings.Astheyhadbeenrival
power721
·
2010-08-13 19:00
exception
Excel
Integer
less
each
output
POJ3132Sum of Different Primes题解
动态规划DP
SumofDifferentPrimesTimeLimit:5000MS MemoryLimit:65536KTotalSubmissions:2160 Accepted:1334DescriptionApositiveintegermaybeexpressedasasumofdifferentprimenumbers(primes),inonewayoranother.Giventwoposit
power721
·
2010-08-12 19:00
Integer
express
input
dataset
output
Numbers
HIT2954PD EERT题解
动态规划DP
http://acm.hit.edu.cn/judge/show.php?Proid=2954&Contestid=0PDEERT Timelimit:1sec.Submitted:82Memorylimit:64MAccepted:35Source:PerfectCai&XnozeroDescriptionMaybeyouhavelearnedthedatastructure--Tree.Now
power721
·
2010-08-12 19:00
tree
Integer
each
output
Numbers
structure
ZOJ2059The Twin Towers题解
动态规划DP
TheTwinTowersTimeLimit:1Second MemoryLimit:32768KBTwintowersweseeyoustandingtall,thoughabuilding'slostourfaithwillneverfall.Twintowerstheworldhearsyourcall,thoughyou'regoneitonlystrengthensourresol
power721
·
2010-08-12 19:00
POJ1062昂贵的聘礼题解
动态规划DP
昂贵的聘礼TimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:15476 Accepted:4108Description年轻的探险家来到了一个印第安部落里。在那里他和酋长的女儿相爱了,于是便向酋长去求亲。酋长要他用10000个金币作为聘礼才答应把女儿嫁给他。探险家拿不出这么多金币,便请求酋长降低要求。酋长说:"嗯,如果你能够替我弄到大祭司的皮袄
power721
·
2010-08-12 14:00
POJ2030The Secret Number题解
动态规划DP
TheSecretNumberTimeLimit:1000MS MemoryLimit:30000KTotalSubmissions:1682 Accepted:554DescriptionYourjobistofindoutthesecretnumberhiddeninamatrix,eachofwhoseelementisadigit('0'-'9')oraletter('A'-'Z').Yo
power721
·
2010-08-11 16:00
POJ1651Multiplication Puzzle题解
动态规划DP
MultiplicationPuzzleTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:3460 Accepted:2034DescriptionThemultiplicationpuzzleisplayedwitharowofcards,eachcontainingasinglepositiveinteger.Duringthemovepl
power721
·
2010-08-11 15:00
POJ1745Divisibility题解
动态规划DP
DivisibilityTimeLimit:1000MS MemoryLimit:10000KTotalSubmissions:6514 Accepted:2161DescriptionConsideranarbitrarysequenceofintegers.Onecanplace+or-operatorsbetweenintegersinthesequence,thusderivingdiff
power721
·
2010-08-11 12:00
File
Integer
input
each
output
POJ3186Treats for the Cows题解
动态规划DP
TreatsfortheCowsTimeLimit:1000MS MemoryLimit:65536KTotalSubmissions:2686 Accepted:1280DescriptionFJhaspurchasedN(1#definemax(a,b)((a)>(b)?(a):(b))intdp[2002][2002];intmain(){intn,i,j,a[2002];scanf("%d
power721
·
2010-08-11 11:00
command
File
Integer
input
each
output
[SCOI2009]windy数 题解
动态规划DP
[SCOI2009]windy数TimeLimit:1000MS MemoryLimit:165536KTotalSubmit:162Accepted:74Descriptionwindy定义了一种windy数。不含前导零且相邻两个数字之差至少为2的正整数被称为windy数。windy想知道,在A和B之间,包括A和B,总共有多少个windy数?Input包含两个整数,AB。Output一个整数。S
power721
·
2010-08-11 11:00
input
output
上一页
5
6
7
8
9
10
11
12
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他