ZOJ 3211 Dream City】的更多相关文章

Dream City Time Limit: 1 Second      Memory Limit: 32768 KB JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n. At the first day, each tree i has aicoins o…
题目链接:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3374 题目大意:JAVAMAN 到梦幻城市旅游见到了黄金树,黄金树上每天回结出金子.已经有n棵树,JAVAMAN要停留m天,每天只能砍掉一棵树,砍掉树后就能得到树上的黄金.给定n棵树上原有的黄金a[i]和每天可以新增加的黄金b[i],求他最多可以得到多少黄金.中途如果有1天不砍树的话,之后的日子久不能砍树,所有最好每天都砍树,或者直到树被砍完. Sample Inp…
题目大意:JAVAMAN 到梦幻城市旅游见到了黄金树,黄金树上每天回结出金子.已经有n棵树,JAVAMAN要停留m天,每天只能砍掉一棵树,砍掉树后就能得到树上的黄金.给定n棵树上原有的黄金a[i]和每天可以新增加的黄金b[i],求他最多可以得到多少黄金.中途如果有1天不砍树的话,之后的日子久不能砍树,所有最好每天都砍树,或者直到树被砍完. 这个其实是个背包问题,把日期看成背包的容量.然后n棵树当成n个物品. 假设我们取得由某 m 棵树组成的最优解.如果先砍的树的b值比后砍的树的b值大, 那么我们…
贪心,$dp$. 假设我们知道要选择哪些物品,那么这些物品应该按什么顺序选择呢? 物品$A(a1,b1)$,物品$B(a2,b3)$. 假设物品$A$在第$x$天被选择,物品$B$在第$y$天被选择.$x<y$.那么收益为:$P1=a1+(x-1)*b1+a2+(y-1)*b2$. 假设物品$A$在第$y$天被选择,物品$B$在第$x$天被选择.$x<y$.那么收益为:$P2=a1+(y-1)*b1+a2+(x-1)*b2$. $P1>P2$的条件为:$(x-1)*b1+(y-1)*b2…
描述 JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tree 1, tree 2 ...and tree n. At the first day, each tree i has ai coins on it (i=1, 2, 3...n). Surprisingly, each tree i can grow…
Design the city Time Limit: 1 Second      Memory Limit: 32768 KB Cerror is the mayor of city HangZhou. As you may know, the traffic system of this city is so terrible, that there are traffic jams everywhere. Now, Cerror finds out that the main reason…
题目链接 题意: 给出一个无向图,类似三角形的样子,然后给出边的权值,问找一条从第一个点到最后一个点的路径,要求每一条边只能走一次,并且权值和最大,点可以重复走. 思路: 首先观察这个图可以发现,所有的点的度数都是偶数.然后由每条边只能走一次知道,这个是和欧拉路相关的,是欧拉道路,不是欧拉回路,因为题目要求是从一个点到另一个点.但是图的所有点的度数都是偶数,那么想办法让图中的第一个点和最后一个点度数变为奇数,其他点的度数都是偶数.这个就比较巧妙,去掉从第一个点到最后一个点的一条无重复点的路径,除…
Dream City Time Limit: 1 Second      Memory Limit:32768 KB JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There aren trees in the yard. Let's call them tree 1, tree 2 ...and treen. At the first day, each treei hasai coins on it…
Dream City Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3211 Description JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There are n trees in the yard. Let's call them tre…
Dream City Time Limit: 1 Second      Memory Limit:32768 KB JAVAMAN is visiting Dream City and he sees a yard of gold coin trees. There aren trees in the yard. Let's call them tree 1, tree 2 ...and treen. At the first day, each treei hasai coins on it…