上一页 1 ··· 13 14 15 16 17
摘要: 点击打开链接 阅读全文
posted @ 2012-05-21 18:45 LJ_COME!!!!! 阅读(94) 评论(0) 推荐(0)
摘要: AC啦!!!此题用到了两个DFS,刚开始一直认为两个DFS是交叉的,一直是错。后来从最简单的方面考虑,它遍历它的,它遍历它的,最后搞出来啦。#include <stdio.h> #include <memory.h> #include <stdlib.h> const int maxn=50+10; char map[maxn][maxn]; int visit[maxn][maxn]; int visit2[maxn][maxn]; int total[maxn]; int amount=0; int m,n,flag; int count1; int d 阅读全文
posted @ 2012-05-21 18:37 LJ_COME!!!!! 阅读(145) 评论(0) 推荐(0)
摘要: 第一道dfs,值得纪念#include <stdio.h> const int max=5; char map[max][max]; int visit[max][max]; int count,k,maxn,n; int judge(int x,int y) { int i,j; for(i=x,j=y-1;j>=0;j--) { if(visit[i][j]==1) return 0; else if(map[i][j]=='X') break; } for(j=y,i=x-1;i>=0;i--) { if(visit[i][j]==1) retur 阅读全文
posted @ 2012-05-18 23:23 LJ_COME!!!!! 阅读(96) 评论(0) 推荐(0)
摘要: #include <iostream> #include <string> #include <stack> using namespace std; const int maxn=53; int mount; stack<string> s[maxn]; void stackInput(); void moveCard(); void finalOutput(); bool isMatch(string s1,string s2); int main() { string str; while(cin >> str,str!=&qu 阅读全文
posted @ 2012-05-18 20:49 LJ_COME!!!!! 阅读(107) 评论(0) 推荐(0)
摘要: 此题不难,典型的DFS,但是却WN了N次。应为本题的测试数据m,n后可能有空格,所以把scanf("%c")改成scanf(“%S);#include <stdio.h> #include <memory.h> const int maxn=100+10; int m,n; int count; int visit[maxn][maxn]; char map[maxn][maxn]; void dfs(int x,int y); int dir[8][2]={{-1,-1},{-1,0},{-1,1},{0,1},{1,1},{1,0},{1,-1} 阅读全文
posted @ 2012-05-18 20:47 LJ_COME!!!!! 阅读(71) 评论(0) 推荐(0)
上一页 1 ··· 13 14 15 16 17