2012年8月5日

hdu 1081To The Max

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1081题意:求子矩阵的和的最大值思路:把多维转化为一维,只要会一维的就简单了。。。To The MaxTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 4842Accepted Submission(s): 2289Problem DescriptionGiven a two-dimensional array of positive and negative 阅读全文

posted @ 2012-08-05 22:35 仁者无敌8勇者无惧 阅读(121) 评论(0) 推荐(0) 编辑

hdu 1548A strange lift

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1548之前用dfs写,,以为可以选择最小的,,当写到那时,就囧了,,不知道怎么处理。。或许真的可以用dfs只是可能要全部搜索才能判断。求路过的大牛指点一二dfs写法!bfs写法:View Code 1 #include<stdio.h> 2 #include<string.h> 3 int map[205]; 4 int vis[205]; 5 int queue[205]; 6 int rear,front; 7 int count; 8 int n; 9 int bfs(int x 阅读全文

posted @ 2012-08-05 21:22 仁者无敌8勇者无惧 阅读(164) 评论(0) 推荐(0) 编辑

hdu 1312Red and Black

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1312题意:就是找从@出发的能经过的'.'的数目。dfs写法:View Code #include<stdio.h>#include<string.h>int col,row;int sx,sy;int sum;int vis[25][25];char map[25][25];void dfs(int x,int y){ if(vis[x-1][y]==0&&map[x-1][y]=='.') { sum++; vis[x-1][y]=1 阅读全文

posted @ 2012-08-05 17:53 仁者无敌8勇者无惧 阅读(207) 评论(0) 推荐(0) 编辑

导航