题意: 一次地震震坏了所有网点 现在开始修复它们 有N个点 距离为d的网点可以进行通信 O p   代表p点已经修复 S p q 代表询问p q之间是否能够通信 思路: 基础并查集 每次修复一个点重新刷一边图就行了 /* *********************************************** Author :Sun Yuefeng Created Time :2016/11/1 15:40:35 File Name :food.cpp ******************…
并查集的介绍可以看下https://www.cnblogs.com/jkzr/p/10290488.html A - Wireless Network POJ - 2236 An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected afters…
An earthquake takes place in Southeast Asia. The ACM (Asia Cooperated Medical team) have set up a wireless network with the lap computers, but an unexpected aftershock attacked, all computers in the network were all broken. The computers are repaired…
SPFA求负环 模板题 记得每组处理之前clear vector /* *********************************************** Author :Sun Yuefeng Created Time :2016/10/25 18:02:02 File Name :A.cpp ************************************************ */ #include<cstdio> #include<iostream>…
题意: 在一个有向图中求n头牛从自己的起点走到x再从x走回来的最远距离 思路一开始是暴力跑dij…… 讲道理不太可能…… 然后就百度了一下 才知道把矩阵转置的话就只需要求两次x的单源最短路…… /* *********************************************** Author :Sun Yuefeng Created Time :2016/10/22 20:09:36 File Name :A.cpp *******************************…
求每条道路的最大承载量 和上一道题差不多 就是松弛的规则从最大值变成了最小值 /* *********************************************** Author :Sun Yuefeng Created Time :2016/10/22 20:09:36 File Name :A.cpp ************************************************ */ #include<cstdio> #include<iostrea…
求第一个点到第二个点的所有通路上最长的边 dijkstra的变形 每次松弛的是每条边通路上的的最长的边 WA了好几次是因为用了%lf 改成%f就过了…… /* *********************************************** Author :Sun Yuefeng Created Time :2016/10/22 14:18:06 File Name :A.cpp ************************************************ */…
求1到N的最短路 注意有重边 跑一遍dijkstra就行 /* *********************************************** Author :Sun Yuefeng Created Time :2016/10/22 14:18:06 File Name :A.cpp ************************************************ */ #include<cstdio> #include<iostream> #inc…
[kuangbin带你飞]专题1-23 专题一 简单搜索 POJ 1321 棋盘问题POJ 2251 Dungeon MasterPOJ 3278 Catch That CowPOJ 3279 FliptilePOJ 1426 Find The MultiplePOJ 3126 Prime PathPOJ 3087 Shuffle'm UpPOJ 3414 PotsFZU 2150 Fire GameUVA 11624 Fire!POJ 3984 迷宫问题HDU 1241 Oil Deposit…
        ID Origin Title   34 / 81 Problem A POJ 3436 ACM Computer Factory   92 / 195 Problem B POJ 3281 Dining   55 / 148 Problem C POJ 1087 A Plug for UNIX   59 / 111 Problem D POJ 2195 Going Home   44 / 132 Problem E POJ 2516 Minimum Cost   35 / 72…