图论
HUGOkungggg
Never go back, where you begun.
展开
-
寒假实录 chapter 4
Intervals题意:给出N个区间(),求一个最短的序列使得序列包含了区间里的至少个数。输出最短的长度。定义为前x个数里包含的数的个数,那么根据题意有,此外即还有。 这样就可以通过差分约束跑spfa求最长路得出答案了。#include <bits/stdc++.h>#include <algorithm>#include <c...原创 2020-02-05 18:14:17 · 149 阅读 · 0 评论 -
2019CCPC网络赛
入报名链接)~ path Time Limit: 2000/2000 MS (Java/Others)Memory Limit: 65536/65536 K (Java/Others) Total Submission(s): 1411Accepted Submission(s): 300 Problem Descriptio...原创 2019-08-25 15:36:14 · 2841 阅读 · 0 评论 -
最短路算法模板(只有代码)
收藏自大佬的文章,和白书上的写法。Dijkstra 算法:int cost[max_v][max_v]; //cost[u][v]表示边e=(u,v)的权值(不存在这条边时设为INF)int d[max_v]; //顶点s出发的最短路距离bool used[max_v]; //已经使用过的图int V; //顶点数//求从起点出发到各个顶点的最短距离void dijkstra...原创 2018-08-24 15:55:31 · 207 阅读 · 0 评论 -
Special topic 2
A - Network of SchoolsPOJ - 1236 A number of schools are connected to a computer network. Agreements have been developed among those schools: each school maintains a list of schools to which it di...原创 2019-04-10 21:46:29 · 209 阅读 · 0 评论 -
2018ICPC徐州现场赛G题
G. Rikka with Intersections of Pathstime limit per test6.0 smemory limit per test1024 MBinputstandard inputoutputstandard outputRikka has a treeTTwithnnvertices numbered from11...原创 2019-10-04 20:09:46 · 545 阅读 · 0 评论