04 2023 档案
摘要:
阅读全文
摘要:占坑
阅读全文
摘要:占坑
阅读全文
摘要:注:弗洛伊德算法也可以在数据范围很小时(级别)求单源最短路,例如3488.最短路径。优点是弗洛伊德算法相对于Dijkstra更好写,就三个for循环,代码比较短,缺点是只有在数据范围是级别才能用。 3488. 最短路径 #include <iostream> #include
阅读全文
摘要:超级(虚拟)源点类型 1488. 最短距离(超级源点) 建立超级源点,从超级源点向某些点连一条权值为0的单向边 #include <iostream> #include <algorithm> #include <cstring> #include <queue> using namespace s
阅读全文
摘要:207. 课程表 const int N = 100010, M = 5010; class Solution { public: int h[N], e[M], ne[M], idx = 0; int in[N], q[N]; void add(int a, int b) { e[idx] = b
阅读全文
摘要:计算B进制的值(秦九韶算法) 4945. 比大小 #include <iostream> #include <cstring> using namespace std; typedef long long LL; LL get() { LL res = 0; int n, b; cin >> n >
阅读全文