摘要: 匈牙利算法 #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include <queue> using namespace std; #define ll long long #define pb 阅读全文
posted @ 2020-05-29 22:21 SummerMingQAQ 阅读(185) 评论(0) 推荐(0) 编辑
摘要: ROADS 思路:K = 10000,dijkstra复杂度O(nlogn),如果我们把不同点的不同花费拆点,即d[花费][点] = 距离,则被拆为 N*K个点,分成K层,则dijkstra复杂度O(k * (n *logn + m)),复杂度在超时边缘徘徊... #include <iostrea 阅读全文
posted @ 2020-05-29 17:19 SummerMingQAQ 阅读(219) 评论(0) 推荐(0) 编辑
摘要: 拯救大兵瑞恩 思路:钥匙种类p = 10,我们可以拥有不同种类钥匙,通过这个我们可以把图分成2^p层,表示拥有不同种类钥匙的情况。 #include <iostream> #include <vector> #include <cstdio> #include <cstring> #include 阅读全文
posted @ 2020-05-29 12:45 SummerMingQAQ 阅读(241) 评论(0) 推荐(0) 编辑