_Sheepsheep
_Sheepsheep
全部文章
分类
题解(5)
归档
标签
去牛客网
登录
/
注册
_Sheepsheep的博客
全部文章
(共5篇)
bfs解法
贴一份bfs解法 #include<iostream> #include<cstdio> #include<queue> #include<string> #include<cstring> #include<algorithm>...
bfs
2021-02-11
1
689
bfs+分类讨论
bfs+分类讨论 (写得比较蠢,应该整一个bfs的函数会简便一点)主要分两种大情况,一是不用钥匙开门就能走到终点,二是要找到钥匙开门才能走到终点。在第一种情况中又有一种小情况,使用钥匙和不使用钥匙都能到达终点时,哪一种路径更短?在第二种情况中,如果能找到钥匙,但从钥匙处出发走不到终点怎么办?如果找不...
bfs
2021-02-11
3
812
贴一个bfs版的
贴一个bfs版的# 刚开始只ac50%,因为把起点默认成(1,1)了orz《论读题的重要性》 #include<iostream> #include<cstdio> #include<queue> #include<string> #include&l...
bfs
2021-02-10
1
655
二分找答案
二分找答案,用一个前缀和,不然会超时x要注意的地方:1.什么时候右边界收缩,什么时候左边界收缩。2.找到答案时,l,r区间不存在,答案出现在l处,即r+1处。 #include<iostream> #include<cstdio> #include<algorithm&...
二分
2021-01-25
3
599
加起来再比字典序√
加起来再比字典序√ #include<cstdio> #include<iostream> #include<algorithm> #include<string> using namespace std; int main() { stri...
贪心
字符串
2021-01-13
0
539