加载中...

随笔分类 -  dfs

摘要:https://www.acwing.com/problem/content/description/4275/ 优质题解:https://www.acwing.com/solution/content/89003/ #include <iostream> #include <vector> #in 阅读全文
posted @ 2022-08-25 12:54 英雄不问出处c 阅读(25) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/1487/ 并查集维护连通块的写法 #include <iostream> #include <cstring> using namespace std; const int N = 1010, M = 500010; i 阅读全文
posted @ 2022-08-22 22:59 英雄不问出处c 阅读(29) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/description/1595/ dp解法 #include <iostream> #include <cstring> using namespace std; const int N = 410; int n, k, 阅读全文
posted @ 2022-08-22 14:10 英雄不问出处c 阅读(63) 评论(0) 推荐(0)
摘要:https://www.acwing.com/problem/content/description/1497/ 思路: 一般这种题型的dijk,我们都可以在dijk中判断出来几个关键字,但这题却不行,因为我们无法确定在哪种情况下更好。所以我们先用一遍dijk来剪枝,找出所有到终点的最短路,然后用d 阅读全文
posted @ 2022-08-21 22:39 英雄不问出处c 阅读(46) 评论(0) 推荐(0)