Polaris_jielun
Polaris_jielun
全部文章
题解
归档
标签
去牛客网
登录
/
注册
小白伦
全部文章
/ 题解
(共3篇)
题解 | #最短路#
前向星图+spfa #include<bits/stdc++.h> using namespace std; int n,m; int head[200005],dist[200005],flag[200005]; int cnt=0; queue<int>q; struct...
最短路
图论
2021-08-05
1
509
题解 | #ACM Battle#
一题不怎么明显的爆搜,刚刚看到题还以为是点覆盖,但是发现转不成二分树,DP也没什么思路,最后只能爆搜。搜点不是很容易,试着搜边。用vis[]数组记录了某点是否被滴过,在搜边时如果两端点又被滴过的直接搜下一个点;若两端点都未搜过则枚举其中一个,然后回溯枚举另一个。其中sum>10可以剪枝,最后看...
2021-07-29
2
491
题解 | #A-逃脱#
刚刚开始看到标签,想使用dfs。但是没有写出来(确信),后面去看看博客,发现都用bfs写的,然后试着写了一下。 AC代码 #include<bits/stdc++.h>; using namespace std; int n, m, t; #define Max 35 int move1...
bfs
2021-07-22
0
487