摘要: 分组背包,学习了!View Code #include <stdio.h>#include <string.h>int dp[105];int max(int a,int b){ return a>b?a:b;}int main(){ int n,m,i,j,k,ar[105][105]; while (scanf("%d%d",&n,&m)!=EOF&&n&&m) { for (i=1;i<=n;i++) { for (j=1;j<=m;j++) { scanf("%... 阅读全文
posted @ 2011-12-20 17:44 104_gogo 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 简单的bfs只是要注意,当楼梯不能通过的时候,可以等带它变过来,这样时间就要加1分钟(位置不变),然后把这个点重新加入队列View Code #include <stdio.h>#include <queue>using namespace std;struct node{ int x,y,t;}a;int n,m,ex,ey;char map[25][25];void bfs(){ int i,row,col,dir[4][2]={0,1,0,-1,1,0,-1,0};//右左下上 char tmp; queue<node> q; a.t=0; q.pus 阅读全文
posted @ 2011-12-20 17:40 104_gogo 阅读(163) 评论(0) 推荐(0) 编辑