上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 45 下一页
摘要: 这道题实际上不需要最短路算法,因为每条边的边权都只有1 要注意在开始读入交通路线之前,要先把一个空行先读掉 这道题是“公交线路” 是有方向的 所以只能连单向边 #include <iostream> #include <cstring> #include <algorithm> #include < 阅读全文
posted @ 2023-10-25 13:10 Gold_stein 阅读(32) 评论(0) 推荐(0)
摘要: 通过取对数把乘法变成加法,然后应用相对应的最短路算法 #include<algorithm> #include<queue> #include<stdio.h> #define R(x) x=read() using namespace std; const int N=2005; int n,m; 阅读全文
posted @ 2023-10-25 10:41 Gold_stein 阅读(17) 评论(0) 推荐(0)
摘要: 换源点来不断进行单源最短路的计算。 #include <stdio.h> #include <stdlib.h> #include <queue> #include <algorithm> #include <cstring> #define R(x) x = read() using namesp 阅读全文
posted @ 2023-10-24 19:42 Gold_stein 阅读(18) 评论(0) 推荐(0)
摘要: 这道题要求的就是最短路中的最大值 注意:Floyd算法中第一重循环是[1,n] 而不是[1,n),因为1~n中任何一个点都有可能是中转点。 #include <iostream> #include <algorithm> #include <cstring> using namespace std; 阅读全文
posted @ 2023-10-24 17:18 Gold_stein 阅读(22) 评论(0) 推荐(0)
摘要: 最短路模板题 #include <stdio.h> #include <stdlib.h> #include <queue> #include <algorithm> #include <vector> #include <cstring> #define R(x) x = read() using 阅读全文
posted @ 2023-10-24 17:12 Gold_stein 阅读(19) 评论(0) 推荐(0)
摘要: 179.八数码 估价函数:曼哈顿距离 #include <iostream> #include <cstring> #include <unordered_map> #include <sstream> #include <queue> #include <vector> #include <alg 阅读全文
posted @ 2023-10-23 19:09 Gold_stein 阅读(21) 评论(0) 推荐(0)
摘要: Dijkstra正确性证明 采用反证法+数学归纳法 设目前已经出对的点得到的都是最短路,那么对于现在刚好出队这个点t来说: 因为它是优先队列的对头,而且图中的边权都是非负数,所以它不可能被队列中的点再更新 因为每个点只会出队一次,所以它也不会被已经出队的点再次更新 还没有入队的点距离更远,也不可能再 阅读全文
posted @ 2023-10-19 18:29 Gold_stein 阅读(34) 评论(0) 推荐(0)
摘要: 前置知识 treap是由BST和heap组合而成的数据结构,这一点也体现在它的名字上:treap=tree+heap BST中,每个节点的左儿子都比它小,右儿子都比它大,可以实现有序的遍历,但是可能因为数据特殊的排列方式,而退化为线性 heap中,每个父节点都是当前子树内权值最大(或最小)的点。 在 阅读全文
posted @ 2023-10-16 11:38 Gold_stein 阅读(59) 评论(0) 推荐(0)
摘要: 额外信息 Bison中百分号的作用:Bison中百分号的作用 - Gold_stein - 博客园 Lv0.环境配置 因为win11默认开启的VBS会导致在游戏等高负载场景显卡占用异常,但是win11又已经关闭了单独关闭vbs同时保留hyperv的通道,所以只能选择一劳永逸地将hyperv关闭。这样 阅读全文
posted @ 2023-10-15 16:46 Gold_stein 阅读(628) 评论(0) 推荐(1)
该文被密码保护。 阅读全文
posted @ 2020-11-09 12:24 Gold_stein 阅读(0) 评论(0) 推荐(0)
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 45 下一页