POJ 2948 Martian Mining(DP)】的更多相关文章

题目链接 题意 : n×m的矩阵,每个格子中有两种矿石,第一种矿石的的收集站在最北,第二种矿石的收集站在最西,需要在格子上安装南向北的或东向西的传送带,但是每个格子中只能装一种传送带,求最多能采多少矿. 思路 :记忆化搜索.也可以用递推. #include <stdio.h> #include <string.h> #include <iostream> using namespace std ; ][] ,blog[][] ; ][] ; int DP(int row…
Description The NASA Space Center, Houston, is less than 200 miles from San Antonio, Texas (the site of the ACM Finals this year). This is the place where the astronauts are trained for Mission Seven Dwarfs, the next giant leap in space exploration.…
[POJ 3071] Football(DP) Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 4350   Accepted: 2222 Description Consider a single-elimination football tournament involving 2n teams, denoted 1, 2, -, 2n. In each round of the tournament, all tea…
Martian Mining Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 2251 Accepted: 1367 Description The NASA Space Center, Houston, is less than 200 miles from San Antonio, Texas (the site of the ACM Finals this year). This is the place where t…
Description A plotter is a vector graphics printing device that connects to a computer to print graphical plots. There are two types of plotters: pen plotters and electrostatic plotters. Pen plotters print by moving a pen across the surface of a piec…
题意:有两棵树,标号为1和2,在Tmin内,每分钟都会有一个苹果从其中一棵树上落下,问最多移动M次的情况下(该人可瞬间移动),最多能吃到多少苹果.假设该人一开始在标号为1的树下. 分析: 1.dp[x][y][z]---第x分钟移动了y次的情况下,现在位于标号为z的树下最多吃到的苹果数. 2.枚举所有的时间.次数和可能位于的树下. 若第i分钟该人位于标号为k的树下,第i + 1分钟苹果从标号为a[i+1]的树上落下. (1)k==a[i], 此人站在标号为k的树下不移动,即可再吃到一个苹果:dp…
题目链接 两种矿石,Y和B,Y只能从从右到左,B是从下到上,每个空格只能是上下或者左右,具体看图.求左端+上端最大值. 很容易发现如果想最优,分界线一定是不下降的,分界线上面全是往上,分界线下面都是往左,然后就发现每一行,只和上一行有关系,DP可搞. 应该可以单调队列优化,我直接暴力水过了.. #include <cstdio> #include <cstring> #include <iostream> #include <cmath> #include…
题目链接 完全自己想的,做了3个小时,刚开始一点思路没有,硬想了这么长时间,想了一个思路, 又修改了一下,提交本来没抱多大希望 居然1A了,感觉好激动..很高兴dp又有所长进. 题意: 一个row*col的矩阵,每个格子内有两种矿yeyenum和bloggium,并且知道它们在每个 格子内的数量是多少.最北边有bloggium的收集站,最西边有 yeyenum 的收集站. 现在要在这些格子上面安装向北或者向西的传送带(每个格子自能装一种).问最多能采到多少矿. 传送带只能直着走,不可弯曲,不能交…
http://poj.org/problem?id=1260 Pearls Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 8474   Accepted: 4236 Description In Pearlania everybody is fond of pearls. One company, called The Royal Pearl, produces a lot of jewelry with pearls…
http://poj.org/problem?id=2192 Zipper Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 17585   Accepted: 6253 Description Given three strings, you are to determine whether the third string can be formed by combining the characters in the…