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 has hid between 0 a…
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…
题意:给出n*n的格子,每个各自里面有些食物,问一只老鼠每次走最多k步所能吃到的最多的食物 这道题目,值得我记住它,re了n次,以前写搜索没有注意的一个小地方,导致re这么多次的 ac代码: #include<iostream> #include<stdio.h> #include<string.h> using namespace std; int dp[110][110],s[110][110]; int n,k,t[4][2]={1,0,-1,0,0,1,0,-1…