![](https://img-blog.csdnimg.cn/20201014180756780.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
模板
少点多些
这个作者很懒,什么都没留下…
展开
-
BFS
#include#include#include #includeusing namespace std;int n, m;char map[205][205];bool visit[205][205];int dir[4][2] ={-1,0,1,0,0,-1,0,1};int bx, by;struct point{ int x, y, step; friend boo原创 2014-07-17 21:10:09 · 367 阅读 · 0 评论 -
算法实质【Matrix67】
动态规划 :你追一个MM的时候,需要对该MM身边的各闺中密友都好,这样你追MM这个问题 就分解为对其MM朋友的问题,只有把这些问题都解决了,最终你才能追到MM。 因此,该问题适用于聪明的MM,懂得“看一个人,不是看他如何对你,而是看 他如何对他人。”的道理,并且对付这样的MM总能得到最优解。但确定是开销 较大,因为每个子问题都要好好对待。。。。 贪心法 :你追一个MM的时候,从相识转载 2015-04-16 00:29:56 · 442 阅读 · 0 评论 -
something
将二维数组变为一维int index;for(int i = 0; i < n; i++){ for(int j = 0; j < m; j++){ index = n*i+j; cin>> a[index]; }}原创 2015-05-13 00:47:50 · 661 阅读 · 0 评论