摘要:
#includeint main(){ int n,a,b,i; int j,s=0; int c[1000]; while ( scanf("%d%d",&a,&b)==2) { j=0; for (n=a;n=n) ... 阅读全文
摘要:
#includeusing namespace std;#include#includeint used[105][105];int a[8][2]={{0,1},{0,-1},{1,0},{-1,0},{1,1},{1,-1},{-1,1},{-1,-1}};char s[105][105];in... 阅读全文
摘要:
#includechar grid[101][101];int n, m;int dir[8][2] = { {-1, -1}, {-1, 0}, {-1, 1}, { 0, 1}, { 1, 1}, { 1, 0}, { 1, -1}, { 0, -1}};void dfs(int x, int ... 阅读全文
摘要:
// 简单 bfs#include #includeusing namespace std;char map[110][110];int flag[110][110];int qu[11000][2],qe,qs,m,n;int add[8][2]={-1,-1, -1,0, -1,1, 0,-1,... 阅读全文
摘要:
//BFS#include #include using namespace std;bool used[8][8];int move[8][2]={1,2, -1,2, -2,1, -2,-1, -1,-2, 1,-2, 2,-1, 2,1};struct position{ int i,j... 阅读全文
摘要:
#include#includeusing namespace std;struct point{ int x, y;};point bufa[8] ={ {-2, 1}, {-1, 2}, {1, 2}, {2, 1}, {2, -1}, {1, -2}, {-1, -2}, {-2, -1}};... 阅读全文
摘要:
// BFS#include #include int visited[301][301]; // visited 已经访问过了int dic[8][2]={{2,1},{1,2},{-1,2},{-2,1},{-2,-1},{-1,-... 阅读全文