摘要:
一:暴力dfs(25分)没有任何优化 #include<bits/stdc++.h> using namespace std; int n,m; int fx[3][2]={{-1,0},{1,0},{0,1}}; int book[1005][1005]; int mp[1005][1005]; 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; struct dt{ int cs,bs; }que[210]; int n,a,b,ans=-1; int yd[205]; int book[205]; int f,r; bool fs=false; vo 阅读全文
摘要:
本题,我用了两种方法,个人认为DFS要更方便一点,至少从代码量来看是这样的 #include<bits/stdc++.h> using namespace std; struct node{ int x,y; }que[12110]; int fx[8][2]={{-1,0},{-1,1},{0,1 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int ax, ay, bx, by; struct node{ int x, y, step; }; node que[10010]; int f, r; bool book[105][105]; int f 阅读全文
摘要:
法一:DFS!!(详细看注释) #include<bits/stdc++.h> using namespace std; int n,m;//行列 char mp[70][70];//地图 int next[4][2]={{-1,0},{1,0},{0,-1},{0,1}};//方向 int ans 阅读全文
摘要:
题目链接:http://ybt.ssoier.cn:8088/problem_show.php?pid=1336 #include<bits/stdc++.h> using namespace std; const int N=205; int n,m,x[N],y[N],sum[N],father 阅读全文
摘要:
#include<bits/stdc++.h> using namespace std; int m, n; char mp[25][25]; int sx, sy, ex, ey; struct node{ //结构体定义位置坐标和起点开始步骤 int x, y, step; }; int dir 阅读全文