随笔分类 - BFS
摘要:#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cstdio> #include<cmath> #include<queue> using namespace std; typed
阅读全文
摘要:两次bfs可得直径,答案一定不会小于所有点到直径的距离最大值,只要把直径上的边权设为0,任选直径上一点bfs可得将最大值作为二分下界,二分直径左右端点的舍弃部分
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std; int xx[5]={0,0,1,-1}, yy[5]={1,-1,0,0}; int bg,ed,h,x,y; int t,w=1; bool ans[5][5],mark[100010]; ...
阅读全文

浙公网安备 33010602011771号