![](https://img-blog.csdnimg.cn/20201014180756925.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
图论
云帆是弟弟
import torch as tf
展开
-
ZOJ-1060 Sort It All Out(拓扑排序 判断全序成环)
An ascending sorted sequence of distinct values is one in which some form of a less-than operator is used to order the elements from smallest to largest. For example, the sorted sequence A, B, C, D im...原创 2020-02-10 01:35:07 · 242 阅读 · 0 评论 -
【模板】A*算法(K短路问题)
介绍 模板题:POJ-2449 #include<iostream> #include<cstdio> #include<cstring> #include<queue> #include<algorithm> #define maxm 2000000 #define maxn 10000 using namespace std; st...原创 2020-01-23 00:24:13 · 130 阅读 · 0 评论 -
The 2019 Aisa Nanchang First Round Online Programming Contest B. Fire-Fighting Hero (最短路+超级源点)
传送门:https://nanti.jisuanke.com/t/41349 Description This is an era of team success, but also an era of heroes. Throughout the ages, there have been numerous examples of using the few to defeat the many...转载 2019-09-19 22:37:40 · 172 阅读 · 0 评论 -
链式前向星【存图模板】
存图方式主要有:邻接矩阵(m[i][j]m[i][j]m[i][j]为w(w!=0),表示i点到j点有一条w权值的路)、邻接表(m[u][i]m[u][i]m[u][i]记录的值为v、w,表示u到v点有一个w权值的路) 用邻接矩阵非常浪费空间,有一种效率高且省空间的存图方法叫链式前向星。 前向星 前向星就是一种邻接表。它是一个边集数组,先将起点按从小到大顺序排列,如果相同则按终点从小到大排序,并记...原创 2019-09-20 22:34:09 · 280 阅读 · 0 评论