
BFS
YOLO(正在修改)
这个作者很懒,什么都没留下…
展开
-
HDU----1242(BFS)
题目链接 Rescue 代码如下 #include<bits/stdc++.h> using namespace std; const int M = 205; int dx[] = {1,0,0,-1}; int dy[] = {0,1,-1,0}; int n,m; int vis[M][M];char mp[M][M]; struct dot { int x,y,time; }; bool in(dot gx) { if(gx.x>=0&&gx.x<n&am原创 2021-08-02 10:27:11 · 66 阅读 · 0 评论 -
HDU----1372(BFS问题)
题目链接 Knigth Moves 代码如下 #include <bits/stdc++.h> using namespace std; int vis[9][9]; int ans=999999999; int sx,sy; int ex,ey; int dis[8][2]= {-1,-2,-2,-1,-2,1,-1,2,1,2,2,1,2,-1,1,-2}; struct node { int x,y; int step; }; int check(int x,int y)原创 2021-07-28 16:43:31 · 132 阅读 · 0 评论 -
HDU----1495(BFS问题)
题目链接 非常可乐 代码如下 #include<bits/stdc++.h> using namespace std; const int M = 105; int s,n,m; struct cup { int v[5]; int step; }temp; int vis[M][M][M],v[5]; void pour(int a,int b) { int sum = temp.v[a]+temp.v[b]; if(sum>=v[b]) temp.v[b] = v[b]; e原创 2021-07-25 18:31:12 · 70 阅读 · 0 评论