随笔分类 -  图论基础(最短路,最小生成树、差分约束)

摘要:http://codeforces.com/gym/102028/problem/F F. Honeycomb time limit per test 4.0 s memory limit per test 1024 MB input standard input output standard o 阅读全文
posted @ 2019-05-19 23:02 yosoro 阅读(163) 评论(0) 推荐(0) 编辑
摘要:Jzzhu is the president of country A. There are n cities numbered from 1 to n in his country. City 1 is the capital of A. Also there are m roads connec 阅读全文
posted @ 2018-05-24 23:56 yosoro 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Six Degrees of Cowvin Bacon Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 6744 Accepted: 3139 Description The cows have been making movie 阅读全文
posted @ 2018-04-14 01:31 yosoro 阅读(128) 评论(0) 推荐(0) 编辑
摘要:Wormholes Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 58636 Accepted: 21921 Description While exploring his many farms, Farmer John has 阅读全文
posted @ 2018-04-14 01:25 yosoro 阅读(140) 评论(0) 推荐(0) 编辑
摘要:Cow Hurdles Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 8506 Accepted: 3751 Description Farmer John wants the cows to prepare for the c 阅读全文
posted @ 2018-04-14 01:18 yosoro 阅读(141) 评论(0) 推荐(0) 编辑
摘要:关于差分约束,有个很好的博客 http://www.cppblog.com/menjitianya/archive/2015/11/19/212292.html https://blog.csdn.net/consciousman/article/details/53812818 Descripti 阅读全文
posted @ 2018-03-28 21:29 yosoro 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Description Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them t 阅读全文
posted @ 2018-03-28 17:47 yosoro 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Description Windy has a country, and he wants to build an army to protect his country. He has picked up N girls and M boys and wants to collect them t 阅读全文
posted @ 2018-03-27 21:24 yosoro 阅读(182) 评论(0) 推荐(0) 编辑
摘要:Description Bessie has moved to a small farm and sometimes enjoys returning to visit one of her best friends. She does not want to get to her old home 阅读全文
posted @ 2018-03-27 17:10 yosoro 阅读(136) 评论(0) 推荐(0) 编辑
摘要:定义:给定一个无向图,如果它的某个子图中的任意两个顶点都互相连通并且是一棵树,那么这棵树就叫生成树(Spanning Tree)如果边存在权值,那么使得边权和最小的生成树叫做最小生成树(MST Minimum Spanning Tree)。 求最小生成树的算法有两种:Prim和Kruskal。Pri 阅读全文
posted @ 2018-03-21 20:51 yosoro 阅读(571) 评论(0) 推荐(0) 编辑
摘要:这是一个关于并查集的入门题目 主要是熟悉并查集这种数据结构 并查集顾名思义就是可以高效查询和合并的一种数据结构 (但是并不能用于分割) 并查集的实现可以用数组操作 用pa(parent)代表并查集内每个树的父节点 ra(rank)代表树的高度 查询和合并用函数完成 在经过防止退化的高度优化和路径压缩 阅读全文
posted @ 2018-03-20 20:12 yosoro 阅读(798) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示