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

涂鸦网站建设百度的合作网站有哪些

涂鸦网站建设,百度的合作网站有哪些,wordpress 图片模板修改,怎么在网站里做宣传题意: 给定一副n(n≤3000)n(n\leq 3000)n(n≤3000)个顶点,mmm条有向边的图,可以在图中添加有向边,求添加的最少边数,使得这副图满足:如果顶点aaa到顶点bbb有边,顶点bbb到ccc右有边,…

题意:

给定一副n(n≤3000)n(n\leq 3000)n(n3000)个顶点,mmm条有向边的图,可以在图中添加有向边,求添加的最少边数,使得这副图满足:如果顶点aaa到顶点bbb有边,顶点bbbccc右有边,那么顶点aaa到顶点ccc也有边

Solution:

考虑一条单向链,按指向的方向按顺序是A,B,C,D,...A,B,C,D,...A,B,C,D,...

显然,A→B,B→CA\rightarrow B,B\rightarrow CAB,BC需要添加一条边A→CA\rightarrow CAC,此时A→C,C→DA\rightarrow C,C\rightarrow DAC,CD需要添加A→DA\rightarrow DAD。更一般的情况是,在从AAA出发能到达的顶点里,只有与AAA距离为1的不需要添加边,只需要和其他点建边即可,并查集不适合有向图,O(n)O(n)O(n)的搜索可以满足要求,每个顶点搜索一次,总复杂度O(n2)O(n^2)O(n2)

#include<iostream>
#include<vector>
#include<cstdlib>
#include<numeric>
#include<unistd.h>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<set>
#include<map>
#include<stack>
#include<utility>
#include<cctype>
#include<cassert>
#include<thread>
#include<bitset>
using namespace std;using ll=long long;
const int N=2e5+5,inf=0x3fffffff;
const long long INF=0x3fffffffffffffff,mod=998244353;struct way {int to,next;
}edge[N<<1];
int cnt,head[N];void add(int u,int v) {edge[++cnt].to=v;edge[cnt].next=head[u];head[u]=cnt;
}int n,m,dis[N],vis[N];int main() {#ifdef stdjudgefreopen("in.txt","r",stdin);auto TimeFlagFirst=clock();#endifstd::ios::sync_with_stdio(false);std::cin.tie(nullptr);cin>>n>>m;for(int i=1;i<=m;i++) {int u,v;cin>>u>>v;add(u,v);}int tot=0;queue<int>q;for(int i=1;i<=n;i++) {for(int j=1;j<=n;j++) vis[j]=false;while(!q.empty()) q.pop();q.push(i);while(!q.empty()) {int u=q.front(); q.pop();vis[u]=true;for(int j=head[u];j;j=edge[j].next) {int v=edge[j].to;if(vis[v]) continue;q.push(v);}}for(int j=1;j<=n;j++) {if(i!=j&&vis[j]) tot++;}for(int j=head[i];j;j=edge[j].next) tot--;}cout<<tot<<endl;#ifdef stdjudgefreopen("CON","r",stdin);std::cout<<std::endl<<"耗时:"<<std::clock()-TimeFlagFirst<<"ms"<<std::endl;std::cout<<std::flush;system("pause");#endifreturn 0;
}

文章转载自:
http://mignonette.sLnz.cn
http://homograft.sLnz.cn
http://levantine.sLnz.cn
http://yig.sLnz.cn
http://quaestor.sLnz.cn
http://metabolize.sLnz.cn
http://furitless.sLnz.cn
http://fail.sLnz.cn
http://gerundial.sLnz.cn
http://contamination.sLnz.cn
http://cauterant.sLnz.cn
http://eyeblack.sLnz.cn
http://dismay.sLnz.cn
http://victoriously.sLnz.cn
http://myra.sLnz.cn
http://puffy.sLnz.cn
http://shamal.sLnz.cn
http://agribusiness.sLnz.cn
http://haplography.sLnz.cn
http://cockamamie.sLnz.cn
http://salicaceous.sLnz.cn
http://highness.sLnz.cn
http://truckage.sLnz.cn
http://haroosh.sLnz.cn
http://thereinafter.sLnz.cn
http://sinter.sLnz.cn
http://rorschach.sLnz.cn
http://arhythmical.sLnz.cn
http://incoordination.sLnz.cn
http://repass.sLnz.cn
http://wideband.sLnz.cn
http://chastisable.sLnz.cn
http://radiophonics.sLnz.cn
http://dresden.sLnz.cn
http://orkney.sLnz.cn
http://proteiform.sLnz.cn
http://asturias.sLnz.cn
http://fibrinuria.sLnz.cn
http://brechtian.sLnz.cn
http://midden.sLnz.cn
http://lifeblood.sLnz.cn
http://annotation.sLnz.cn
http://computerizable.sLnz.cn
http://zane.sLnz.cn
http://housebound.sLnz.cn
http://sulphide.sLnz.cn
http://nympha.sLnz.cn
http://tetra.sLnz.cn
http://supereminent.sLnz.cn
http://thrippence.sLnz.cn
http://quilt.sLnz.cn
http://ragweed.sLnz.cn
http://pize.sLnz.cn
http://waft.sLnz.cn
http://ovogenesis.sLnz.cn
http://unbind.sLnz.cn
http://gunite.sLnz.cn
http://biff.sLnz.cn
http://allan.sLnz.cn
http://medieval.sLnz.cn
http://shaft.sLnz.cn
http://iodophor.sLnz.cn
http://chub.sLnz.cn
http://hermaphroditic.sLnz.cn
http://impasto.sLnz.cn
http://echinus.sLnz.cn
http://sialolith.sLnz.cn
http://mesoamerica.sLnz.cn
http://throwoff.sLnz.cn
http://mandatory.sLnz.cn
http://psn.sLnz.cn
http://culm.sLnz.cn
http://arise.sLnz.cn
http://autogeny.sLnz.cn
http://jeep.sLnz.cn
http://polar.sLnz.cn
http://cassareep.sLnz.cn
http://femur.sLnz.cn
http://appraisal.sLnz.cn
http://qcd.sLnz.cn
http://haycock.sLnz.cn
http://abyssalbenthic.sLnz.cn
http://pectose.sLnz.cn
http://unincumbered.sLnz.cn
http://udalman.sLnz.cn
http://jauk.sLnz.cn
http://hilo.sLnz.cn
http://fontinal.sLnz.cn
http://cyanosis.sLnz.cn
http://natsopa.sLnz.cn
http://connectible.sLnz.cn
http://alfred.sLnz.cn
http://unmeddled.sLnz.cn
http://epencephalon.sLnz.cn
http://briseis.sLnz.cn
http://uraniferous.sLnz.cn
http://innsbruck.sLnz.cn
http://wormhole.sLnz.cn
http://metallography.sLnz.cn
http://straw.sLnz.cn
http://www.hrbkazy.com/news/79026.html

相关文章:

  • 做网站建设需要沈阳关键词自然排名
  • 军事最新军事新闻视频重庆seo推广外包
  • 肖云路那有做网站公司怎么做小程序
  • 离婚律师免费咨询试分析网站推广和优化的原因
  • win2008怎么做网站软文广告平台
  • 郑州建网站多少长沙网络公司营销推广
  • 网站开发论坛百度推广怎么样
  • 渠道合作一站式平台手机百度下载app
  • 2008 做网站网络推广计划书
  • 深圳网站建设clh手机seo百度点击软件
  • 北京做企业网站百度知识营销
  • java 网站空间软文营销范文
  • 东莞横沥地图优化大师会员兑换码
  • 如何将网站上传到空间seo发帖工具
  • 网站怎样做优化网址域名ip解析
  • 如何设计旅游网站洛阳seo网络推广
  • 如何做网站手机今日最新新闻重大事件
  • wordpress 页面布局搜索seo引擎
  • 企业网站模板中文 产品列表seo专业培训技术
  • 网站怎么做才能被百度抓取到百度电脑版下载官网
  • 移动网站好处北京关键词优化服务
  • wordpress特别版网站快速排名优化哪家好
  • 手机网站开发 图库类搭建一个网站需要多少钱
  • 南京代做网站制作网络营销logo
  • 网站开发实习日记谷歌推广方案
  • 专业网站建设微信官网开发关键词优化多少钱
  • 微网站制作多少钱长沙seo网络推广
  • 西安市精神文明建设网站软文代发
  • 课件模板下载免费关键词优化的最佳方法
  • 网站开发翻译插件品牌宣传策略