图论
文章平均质量分 89
图论
Dream Flying Eagle
这个作者很懒,什么都没留下…
展开
-
Control(网络流-最小割-最大流)
Control(网络流-最小割-最大流)judge:HDUOJ 4289source:2012 ACM/ICPC Asia Regional Chengdu OnlineTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Problem DescriptionYou, the he...原创 2019-08-13 15:38:43 · 125 阅读 · 0 评论 -
贴一个最大流板子
贴一个最大流板子#include <iostream>#include <algorithm>#include <queue>#include <cstring>#include <cstdio>#include <string>#include <map>const int maxn = 810;...原创 2019-08-13 11:23:24 · 122 阅读 · 0 评论 -
A Plug for UNIX(网络流-最大流-dinic算法)
A Plug for UNIX(网络流-最大流-dinic算法)judge:POJ 1087Time Limit: 1000MS Memory Limit: 65536Ksource:East Central North America 1999DescriptionYou are in charge of setting up the press room for the inau...原创 2019-08-05 09:34:23 · 401 阅读 · 0 评论 -
Dining(最大流-拆点-EK算法-Dinic算法)
Dining(最大流-拆点-EK算法-Dinic算法)judge:POJ 3281Time Limit: 2000MS Memory Limit: 65536Ksource:USACO 2007 Open GoldDescriptionPOJ 3281InputPOJ 3281OutputPOJ 3281Sample Input4 3 32 2 1 2 3 12 2 ...原创 2019-08-04 11:01:15 · 377 阅读 · 0 评论 -
Hawk-and-Chicken(强连通-tarjan算法)
Hawk-and-Chicken(强连通-tarjin算法)描述Kids in kindergarten enjoy playing a game called Hawk-and-Chicken. But there always exists a big problem: every kid in this game want to play the role of Hawk.So the...原创 2019-07-30 18:54:16 · 391 阅读 · 0 评论 -
2021寒假图论复习计划(1)(hduoj4289,poj2516,poj1087,poj1523)
Control-2012 ACM/ICPC Asia Regional Chengdu Online(2020ICPC成都站网络赛)(网络流-最小割)judge: HDUOJ4289题意现有 nnn 个点,mmm 条边,每个点有一定的权值。请选出总权值之和最小的点集,使得从 SSS 到 TTT 的任何一个路径都至少包含一个点集中的点。你只需要输出点集的总权值。题目保证从 SSS 到 TTT 一定有至少一条路径。题解拆点,把点 uuu 拆成 uuu 和 n+un+un+u。一个作为“入点”,原创 2021-01-13 17:05:41 · 152 阅读 · 0 评论 -
2021寒假图论复习计划(2)(hduoj3639,hduoj1045,hduoj2444,hduoj1083)
Hawk-and-Chicken(2010 ACM-ICPC Multi-University Training Contest(19)——Host by HDU)(Tarjin)judge: HDUOJ3639题意nnn 个学生,每个学生都有一张选票,一共进行 mmm 次投票。每次会有一个学生投票给另一个学生。票可以累加传递,但学生不能从自己手里获得选票。当AAA->CCC,BBB->CCC,CCC->DDD,CCC->EEE时,AAA,BBB的票数为000,CCC原创 2021-01-14 22:06:16 · 165 阅读 · 0 评论 -
2020ICPC·小米 网络选拔赛第一场题解(D,J)
链接:https://ac.nowcoder.com/acm/contest/7501来源:牛客网A签到题D-Router Mesh时间限制:C/C++ 1秒,其他语言2秒空间限制:C/C++ 262144K,其他语言524288K64bit IO Format: %lldjudge:牛客竞赛In a Mesh networking system, there are nnn MI Routers, where mmm pairs of MI Routers are bidirecti原创 2020-10-28 13:21:53 · 744 阅读 · 0 评论 -
Information Transmission-2(2019第十二届ICPC-ACM河南省赛-G-强连通分量)
Information Transmission-2(2019第十二届ICPC-ACM河南省赛-G-强连通分量)看到这题第一感觉是惊喜,因为作为新生遇到自己学过的算法题不容易。但是等我想上手敲的时候却无从下手!!不知不觉连不久前刚刷过的专题都手生了。。。学的东西多了,复习就变成了一件大事……题目描述Information plays a very important role in peo...原创 2019-08-09 19:09:41 · 485 阅读 · 0 评论 -
SPF(强连通-求割点及对应的连通分量数)
SPF(强连通-求割点及对应的连通分量数)judge:POJ 1523Time Limit: 1000MS Memory Limit: 10000Ksource:Greater New York 2000DescriptionConsider the two networks shown below. Assuming that data moves around these net...原创 2019-08-04 14:49:36 · 214 阅读 · 0 评论 -
Treasure Exploration(二分图匹配+Floyd最短路)
Treasure Exploration(二分图匹配-匈牙利算法+最短路-Floyd算法)描述Have you ever read any book about treasure exploration? Have you ever see any film about treasure exploration? Have you ever explored treasure? If you ...原创 2019-07-20 11:16:22 · 331 阅读 · 0 评论 -
Optimal Milking-POJ - 2112(多重匹配+二分)
Optimal Milking-POJ - 2112(多重匹配+二分)source:USACO 2003 U S Openjudge:vjudgeTime limit:2000 msCase time limit:1000 msMemory limit:30000 kBOS:Linux描述FJ has moved his K(1<=K<=30)K (1 ...原创 2019-07-23 20:46:46 · 196 阅读 · 0 评论 -
2021寒假图论复习计划(3)(hduoj1281,hduoj2819,hduoj2389,hduoj4185)
棋盘游戏(二分图匹配)OJ:hduoj 1281VJudge题意对一个 n×mn\times mn×m 的棋盘,可以在格子里放一些象棋里面的“车”,并且使得他们不互相攻击。在保证尽量多的“车”的前提下,棋盘里有些格子是可以避开的,也就是说,不在这些格子上放车,也可以保证尽量多的“车”被放下。但是某些格子若不放子,就无法保证放尽量多的“车”,这样的格子被称做重要点。算出有多少个这样的重要点。题解以每一行作为左点集,每一列作为右点集,每一个可放点连一条从行到列的边,建立二分图。代码// #原创 2021-01-22 22:22:01 · 196 阅读 · 0 评论 -
Rain on your Parade(二分图匹配-Hopcroft-Carp算法)
Rain on your Parade(二分图匹配-Hopcroft-Carp算法)judge:链接Time limit:3000 msMemory limit:165535 kBOS:WindowsSource:HDU 2008-10 Public Contest参考自:链接描述You’re giving a party in the garden of your villa b...原创 2019-07-15 13:36:09 · 321 阅读 · 0 评论 -
二分图匹配详解(看了那么多就看懂了这个)
二分图匹配详解(保证能看懂)https://blog.csdn.net/qq_41730082/article/details/81162561转载 2019-06-07 15:10:38 · 303 阅读 · 0 评论 -
Jamie's Contact Groups(二分图匹配-多重匹配+二分)
Jamie’s Contact Groups(二分图匹配-多重匹配+二分)source:Shanghai 2004judge:vjudgeTime limit:7000 msMemory limit:65536 kBOS:Linux描述Jamie is a very popular girl and has quite a lot of friends, so she always ...原创 2019-07-21 09:36:06 · 16947 阅读 · 0 评论 -
2021寒假图论复习计划(4)(hduoj3020)
Antenna Placement(二分图匹配)oj: hduoj 3020VJudge题意有一个 n×mn\times mn×m 的网格,网格内有若干个城市,每个基站可以覆盖两个相邻得城市。请你使用尽可能少的基站覆盖所有的城市。题解先把相邻的城市之间连边建立二分图,然后求最小路径覆盖。先给出一些概念:匹配:给定一个二分图,在 GGG 的一个子图 G′G'G′ 中,如果 G′G'G′ 的边集中的任意两条边都不依附于同一个顶点,则称 G′G'G′ 的边集为 GGG 的一个匹配。最大匹配原创 2021-01-22 22:21:16 · 193 阅读 · 0 评论 -
Cat VS Dog(二分图匹配)
Cat VS Dog(二分图匹配)描述The zoo have N cats and M dogs, today there are P children visiting the zoo, each child has a like-animal and a dislike-animal, if the child’s like-animal is a cat, then his/hers ...原创 2019-07-20 14:05:00 · 282 阅读 · 0 评论 -
2021牛客寒假算法基础集训营4部分题解(A,B,D,E,F,G,H,I,J)
oj: 牛客A 九峰与签到题oj: 牛客题解签到题代码#pragma GCC optimize(2)#include <bits/stdc++.h>#define _for(i, a) for(int i = 0, lennn = (a); i < lennn; ++i)#define _rep(i, a, b) for(int i = (a), lennn = (b); i <= lennn; ++i)#define nl(i, n) (i == n - 1 ?原创 2021-02-20 16:18:12 · 523 阅读 · 8 评论 -
Jungle Roads(最小生成树-并查集-克鲁斯卡尔算法-Kruskal)
Networking(最小生成树-并查集-克鲁斯卡尔算法-Kruskal)描述The Head Elder of the tropical island of Lagrishan has a problem. A burst of foreign aid money was spent on extra roads between villages some years ago. But th...原创 2019-05-24 21:57:21 · 341 阅读 · 0 评论 -
AND Minimum Spanning Tree(2019杭电多校训练赛第四场-签到题)
AND Minimum Spanning Tree(2019杭电多校训练赛第四场-签到题)judge:hduoj 6614source:2019 Multi-University Training Contest 4Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/131072 K (Java/Others)Proble...原创 2019-07-31 23:06:25 · 186 阅读 · 0 评论 -
Cow Contest(最短路)
Cow Contest(最短路)Time limit:1000 msMemory limit:65536 kBOS:Linuxjudge:https://vjudge.net/contest/297882#problem/H描述N (1 ≤ N ≤ 100) cows, conveniently numbered 1…N, are participating in a programm...原创 2019-05-06 22:24:37 · 385 阅读 · 0 评论 -
Currency Exchange(最短路)
Currency Exchange(最短路)描述Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and performs exchange operations only with t...原创 2019-05-06 22:06:26 · 388 阅读 · 0 评论 -
Til the Cows Come Home(最短路-Dijkstra)
Til the Cows Come Home(最短路-Dijkstra)描述Bessie is out in the field and wants to get back to the barn to get as much sleep as possible before Farmer John wakes her for the morning milking. Bessie needs...原创 2019-04-29 21:05:27 · 276 阅读 · 0 评论 -
Silver Cow Party(最短路)
Silver Cow Party(最短路)Time limit:2000 msMemory limit:65536 kBOS:Linuxjudge:https://vjudge.net/contest/297882#problem/D描述One cow from each of N farms (1 ≤ N ≤ 1000) conveniently numbered 1…N is go...原创 2019-05-06 20:50:52 · 343 阅读 · 0 评论 -
Wormholes(最短路)
Wormholes(最短路)Time limit:2000 msMemory limit:65536 kBOS:Linuxjudge:https://vjudge.net/contest/297882#problem/F描述While exploring his many farms, Farmer John has discovered a number of amazing wor...原创 2019-05-06 22:16:52 · 430 阅读 · 0 评论 -
MPI Maelstrom(最短路)
MPI Maelstrom(最短路)Time limit:1000 msMemory limit:10000 kBOS:Linuxjudge:https://vjudge.net/contest/297882#problem/G描述BIT has recently taken delivery of their new supercomputer, a 32 processor Apo...原创 2019-05-06 22:20:37 · 277 阅读 · 0 评论 -
Heavy Transportation(最短路)
Heavy Transportation(最短路)描述BackgroundHugo Heavy is happy. After the breakdown of the Cargolifter project he can now expand business. But he needs a clever man who tells him whether there really is ...原创 2019-05-06 20:37:34 · 479 阅读 · 0 评论 -
Frogger(最短路)
Frogger(最短路)Time limit:1000 msMemory limit:65536 kBOS:Linuxjudge:https://vjudge.net/contest/297882#problem/B描述Freddy Frog is sitting on a stone in the middle of a lake. Suddenly he notices Fiona...原创 2019-05-06 20:29:35 · 252 阅读 · 0 评论 -
最短路的三种算法(Floyd、Dijkstra、SPFA)
转载自:https://blog.csdn.net/qq_36932169/article/details/78806863前言乍一看搜索跟这个一样都可以找出一个点到另一个点的最短距离,但是有些问题两者都可以解决,而另一些搜索就不能解决了,搜索有确定的方向一步一步走,而最短路是告诉你某两个点直接可以直接走,没有确定的方向。最短路问题,通俗的说就是就是给你n个点,m条边,然后找出某两个点之间的最...转载 2019-04-27 13:14:14 · 930 阅读 · 0 评论 -
CCPC2019哈尔滨站(E - Exchanging Gifts)(拓扑图+map合并)
CCPC2019哈尔滨站(E - Exchanging Gifts)(拓扑图+map合并)time limit per test1 secondmemory limit per test512 megabytesinputstandard inputoutputstandard outputDescriptionAfter the dress rehearsal of CCPC H...原创 2020-02-23 17:32:57 · 2125 阅读 · 2 评论