随笔分类 -  图论板子

摘要:struct MCMF { struct edge { int to, cap, cost, rev; //edge() {} //edge(int to, int _cap, int _cost, int _rev) : to(to), cap(_cap), cost(_cost), rev(_rev) {} }; int V, H[maxn + 5], dis[maxn + 5], PreV[ 阅读全文
posted @ 2019-08-30 20:21 柳清浅 阅读(217) 评论(0) 推荐(0)
摘要:问题 E: Plug It In! 题目描述 Adam just moved into his new apartment and simply placed everything into it at random. This means in particular that he did not 阅读全文
posted @ 2019-08-19 11:52 柳清浅 阅读(241) 评论(0) 推荐(0)
摘要:链式前向星与vector的两种邻接表建图 vector建图简单直观,加边灵活,但占用内存大。 链式前向星建图比较容易操作。 链式前向星 vector 阅读全文
posted @ 2019-08-07 10:22 柳清浅 阅读(802) 评论(0) 推荐(0)
摘要:int linker[N*2]; bool used[N*2]; vectormp[N]; bool dfs(int u) { int len=mp[u].size(); for(int i=0;i<len;i++) { int v=mp[u][i]; if(!used[v]) { used[v]=t... 阅读全文
posted @ 2019-07-27 10:37 柳清浅 阅读(121) 评论(0) 推荐(0)