A Refining Company LightOJ - 1036】的更多相关文章

A Refining Company LightOJ - 1036 描述好长啊... 题意:在m*n的矩阵上,每一格摆一个向上或者向左的传送带(不能同时摆,只能摆一个).同时,每一格有两种物资Uranium和Radium.会给出两个矩阵,分别表明每一格Uranium和Radium的数量.每一种物资可以通过传送带按照其方向传送,但不能转向(遇到不同方向的传送带物品就失效).Radium要送到上面(第一行任意位置),Uranium要送到左面(左起第一列任意位置),送到错误位置的物资将废弃.求最终送到…
1036 - A Refining Company   PDF (English) Statistics Forum Time Limit: 3 second(s) Memory Limit: 32 MB Its year 2200, planet Earth is out of resources and people are relying on the resources from other planets. There are several Refining Companies wh…
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1036 题解:设dp[i][j]表示处理到(i,j)点时的最大值然后转移显然是 dp[i][j] = max(dp[i - 1][j] + asum[i][j] , dp[i][j - 1] + bsum[i][j]); 要么取一整列要么取一整行. #include <iostream> #include <cstring> #include <cstdio…
题目大意: 一个m*n的矩阵,里面有两种矿物质铀和镭,现在要把铀和镭运送到指定位置.北边是炼镭厂,西边是了炼铀厂. 现在要建立传送带,传送带有两种,一种是从东到西,另一种是从南到北,传送带不能交叉,并且运送中途不能中断.现在你要计算出最多能采集多少矿. 输入数据:第一个m*n的矩阵代表铀的矿物质分布, 第二个矩阵代表镭的矿物质分布. 题目分析: 记忆化搜索写起来比较方便点,把数据进行一下简单的预处理就行了.       #include<cstdio> #include<cstring&…
题目链接:http://lightoj.com/volume_showproblem.php?problem=1036 #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #include <algorithm> #include <queue> #include <vector> using namespace std; ;…
题目大概说有一个n*m的格子地图,每个格子有铀或者镭矿.地图最北面的镭矿加工厂,最西面有铀矿加工厂,而要通过在格子里铺设由南向北(镭)或由东向西(铀)的轨道来送矿物到加工厂.一个格子只能铺设一种轨道,即要嘛运送铀要嘛运送镭,不同轨道也不能相交.现在知道地图上各个格子铀和镭的数量,问怎么铺设轨道使送到加工厂的矿物数量最多. 首先明确要运送某一格子的镭矿到北面加工厂,这个轨道肯定是直直连续往上的:而铀矿同理,是水平连续向左的轨道. 另外,因为获得的数量要最多,各个格子肯定都要铺设轨道,反证可知. 然…
好吧,这名字真是让我想起了某段被某教科书支配的历史.....各种DP题层出不穷,不过终于做完了orz 虽然各种手糊加乱搞,但还是要总结一下. T1 Monkey Banana Problem    这道题和数塔问题差不多,不过多了一个倒过来的 代码如下: #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> using namespace std; ][],t,n;…
1221 - Travel Company PDF (English) Statistics problem=1221" style="color:rgb(79,107,114)">Forum Time Limit: 2 second(s) Memory Limit: 32 MB A travel company is planning to launch their bus service in a new route. So they conducted a sur…
http://www.lightoj.com/volume_showproblem.php?problem=1011 You work in a company which organizes marriages. Marriages are not that easy to be made, so, the job is quite hard for you. The job gets more difficult when people come here and give their bi…
http://lightoj.com/volume_showproblem.php?problem=1422 做的第一道区间DP的题目,试水. 参考解题报告: http://www.cnblogs.com/ziyi--caolu/p/3236035.html http://blog.csdn.net/hcbbt/article/details/15478095 dp[i][j]为第i天到第j天要穿的最少衣服,考虑第i天,如果后面的[i+1, j]天的衣服不要管,那么dp[i][j] = dp[i…