随笔分类 -  最短路

摘要:题目大意:给出一张左上角点为(1,1),右下角点为(N,M)(上图中N=4,M=5).有以下三种类型的道路1:(x,y)<==>(x+1,y)2:(x,y)<==>(x,y+1)3:(x,y)<==>(x+1,y+1)n,m<=1000求最小割. 数据太大,网络流会很卡(不太清楚用一些玄学的底层优化 阅读全文
posted @ 2021-05-28 20:45 _LH2000 阅读(158) 评论(0) 推荐(0)
摘要:#include<cstdio>#include<queue>using namespace std;int l[100001],tot,dis[100001],s,n,m;inline int read()//输入优化{ int d=1,f=0;char c; while(c=getchar(), 阅读全文
posted @ 2020-03-09 15:55 _LH2000 阅读(135) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; const int maxn=1010; const int inf=0x3f3f3f3f; int n,m; struct node{ int v,w; node(){ } node(int _v,int _ 阅读全文
posted @ 2020-03-03 20:13 _LH2000 阅读(158) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; int n,m; struct node{//结构体 int v,w; node(){ }; node(int _v,int _w){ v=_v; w=_w; } }; vector <node> g[1010 阅读全文
posted @ 2020-03-03 20:11 _LH2000 阅读(260) 评论(0) 推荐(0)
摘要:http://codeforces.com/contest/1320/problem/B题目链接 题目给你一个有向图,然后再给你一条路径<u,v>,每次最短路的路径变化的话会重新导航,让你求出在<u,v>这条路径上重新导航次数的最小值和最大值。 题意很明了,可先用dij求出终点到所有点的最短路; 然 阅读全文
posted @ 2020-03-02 16:30 _LH2000 阅读(248) 评论(0) 推荐(1)
摘要:第三次写博客,请多指教! 这篇博客是本人为了回顾思路,各位看官爱看不看(手动滑稽)! http://codeforces.com/contest/1307/problem/D 题目链接 题目大意就是要你从k个特殊点选出两个点连边,问连边之后1到n的最短路距离最大是多少 那么直接说思路,先用bfs找出 阅读全文
posted @ 2020-02-28 21:29 _LH2000 阅读(120) 评论(0) 推荐(0)