当前位置: 首页 > news >正文

网站建设 东方网景wordpress仿美拍

网站建设 东方网景,wordpress仿美拍,赣州人才市场最新招聘信息,推广软文平台正题 题目大意:https://www.luogu.com.cn/problem/P4123 题目大意 一张无向图#xff0c;求所有点对之间有多少不同的最小割。 解题思路 考虑分治的做法#xff0c;如果我们得知了(s,t)(s,t)(s,t)的最小割www#xff0c;并且剩下的残量网络中连通点集SSS与sss连通#x…正题 题目大意:https://www.luogu.com.cn/problem/P4123 题目大意 一张无向图求所有点对之间有多少不同的最小割。 解题思路 考虑分治的做法如果我们得知了(s,t)(s,t)(s,t)的最小割www并且剩下的残量网络中连通点集SSS与sss连通点集TTT与ttt连通。那么点集SSS到TTT的每个点对之间的最小割都是www。然后分治到两个点集去做即可。 这样下来最小割的期望次数是O(n)O(n)O(n)级别的可以通过本题。 codecodecode #includecstdio #includecstring #includealgorithm #includequeue #includemap using namespace std; const int N900,inf2147483647/3; struct node{int to,next,w,ret; }a[N*20]; int n,m,ls[N],tot1; int dep[N],p[N],ans; mapint,int mp; queueint q; void addl(int x,int y,int w){a[tot].toy;a[tot].nextls[x];ls[x]tot;a[tot].ww;a[tot].retw;a[tot].tox;a[tot].nextls[y];ls[y]tot;a[tot].ww;a[tot].retw;return; } bool bfs(int s,int t){memset(dep,0,sizeof(dep));dep[s]1;while(!q.empty())q.pop();q.push(s);while(!q.empty()){int xq.front();q.pop();for(int ils[x];i;ia[i].next){int ya[i].to;if(dep[y]||!a[i].w)continue;dep[y]dep[x]1;if(yt)return 1;q.push(y);}}return 0; } int dinic(int x,int flow,int t){int rest0,k;if(xt)return flow;for(int ils[x];i;ia[i].next){int ya[i].to;if(dep[x]1!dep[y]||!a[i].w)continue;rest(kdinic(y,min(flow-rest,a[i].w),t));a[i].w-k;a[i^1].wk;if(flowrest)return flow;}if(!rest)dep[x]0;return rest; } bool cmp(int x,int y) {return dep[x]dep[y];} void solve(int l,int r){if(lr)return;int w0; while(bfs(p[l],p[r]))wdinic(p[l],inf,p[r]);if(!mp.count(w))mp[w]1,ans;sort(pl,p1r,cmp);int midl;for(int il;ir;i)if(dep[p[i]]){midi;break;}for(int i1;itot;i)a[i].wa[i].ret;solve(l,mid-1);solve(mid,r);return; } int main() {scanf(%d%d,n,m);for(int i1;in;i)p[i]i;for(int i1;im;i){int x,y,w;scanf(%d%d%d,x,y,w);addl(x,y,w);}solve(1,n);printf(%d\n,ans); }
http://www.yutouwan.com/news/434514/

相关文章:

  • 企业网络营销网站设计免费个人主页网站
  • 来宾住房和建设局网站揭阳网站开发定制
  • 建设报名系统网站网站关键词抓取
  • 电子商务网站建设结业论文网站开发模块就业前景
  • 个人网站开发总结文档杭州外贸公司
  • 电脑网站拒绝连接怎么解决艺术字logo生成器
  • 带娃儿做的工作网站正安网站建设
  • 口碑营销网站南京手机网站设计哪里专业
  • 合肥网站定制公司自己做网站赚钱案例
  • 蝴蝶传媒网站推广wordpress修改自己的头像
  • 网站开发员wordpress的程序文件
  • 华为建站wordpress网站设计依赖于什么设计
  • 车子网站wordpress阿里云卡死了
  • 电子商务网站开发岗位工商局网站怎么做股东实名认证
  • 宜昌网站建设开发费用北京朝阳区二手房出售
  • 周至做网站的公司做销售用什么网站
  • 电商和网站设计哪个好互联网经营许可证
  • 国外做婚纱摄影店设计的网站建站技术知识
  • 网站设计公司种类长沙做网站需要多少钱
  • 免费的公司网站怎么做建设网站需要哪些条件
  • 南宁建站模板展示app系统软件开发
  • 网站后台图片并排怎么做成都网站建设 赢展
  • 把网站做成app沙洋建设局网站
  • 国外调色教程网站广州专业制作网站
  • 哈尔滨网站设计哪家公司好手机百度2020
  • 建设网站的步骤知乎展厅室内设计公司
  • 公司网站网页设计下载wordpress 4.8.1
  • 广告设计网站建设怎么做汕头seo代理商
  • 网站注册和进入asp关键词数据
  • 网站域名年龄网站开发百度百科