ZOJ 1107 FatMouse and Cheese】的更多相关文章

原题链接 题目大意:FM在一个街道n*n街道的(0,0)点,在每个网格里放着cheese,他要尽可能多的吃这些cheese.有两个规则:1)他跑的总距离不能超过k步:2)下一个节点的cheese的块数必须超过这个节点. 解法:题目是去年秋天做的,现在看了下貌似就是用一下广搜,从原点开始一个个查找.我直接把当时的代码贴过来了,看看当时写的注释,发现暑假都过了一半了,算法都没有总结好.惭愧了. 参考代码: #include<string.h> using namespace std; int n,…
题目链接:点击链接 题目大意:老鼠从(0,0)出发,每次在同一个方向上最多前进k步,且每次到达的位置上的数字都要比上一个位置上的数字大,求老鼠经过的位置上的数字的和的最大值 #include<stdio.h> #include<string.h> #define max(a,b) a>b?a:b int n; int k;//前进的步数 int map[105][105]; int ans[105][105];//记忆化搜索,保存中间搜索结果 int search(int x…
FatMouse and Cheese Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 8610    Accepted Submission(s): 3611 Problem Description FatMouse has stored some cheese in a city. The city can be considere…
pid=1078">FatMouse and Cheese Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 4811    Accepted Submission(s): 1945 Problem Description FatMouse has stored some cheese in a city. The city can…
FatMouse and Cheese Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7576    Accepted Submission(s): 3133 Problem Description FatMouse has stored some cheese in a city. The city can be considered…
FatMouse and Cheese Time Limit:1000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is la…
题目大意:   给n*n地图,老鼠初始位置在(0,0),它每次行走要么横着走要么竖着走,每次最多可以走出k个单位长度,且落脚点的权值必须比上一个落脚点的权值大,求最终可以获得的最大权值   (题目很容易会理解错题意,道友小心) #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace…
FatMouse and Cheese Problem Description FatMouse has stored some cheese in a city. The city can be considered as a square grid of dimension n: each grid location is labelled (p,q) where 0 <= p < n and 0 <= q < n. At each grid location Fatmouse…
HDU 1078 FatMouse and Cheese ( DP, DFS) 题目大意 给定一个 n * n 的矩阵, 矩阵的每个格子里都有一个值. 每次水平或垂直可以走 [1, k] 步, 从 (0, 0) 点开始, 下一步的值必须比现在的值大. 问所能得到的最大值. 解题思路 一般的题目只允许 向下 或者 向右 走, 而这个题允许走四个方向, 所以状态转移方程为 dp(x, y) = dp(nextX, nextY) + arr(x, y); dp 代表在 x, y 的最大值. 由于 下一…
FatMouse and Cheese Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14253    Accepted Submission(s): 6035 Problem Description FatMouse has stored some cheese in a city. The city can be considere…