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

v9做的网站被攻击链接吧跳转哪个公司建设网站

v9做的网站被攻击链接吧跳转,哪个公司建设网站,天津市住房与城乡建设部网站,上海出口贸易公司文章目录 强联通分量SCC概念例子有向图的DFS树代码例题讲解[POI2008] BLO-Blockade题面翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 思路AC代码 【模板】割点#xff08;割顶#xff09;题目背景题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 提示… 文章目录 强联通分量SCC概念例子有向图的DFS树代码例题讲解[POI2008] BLO-Blockade题面翻译题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 思路AC代码 【模板】割点割顶题目背景题目描述输入格式输出格式样例 #1样例输入 #1样例输出 #1 提示 思路AC代码 强联通分量SCC SCC之前也有写博客讲解 戳这里 概念 在有向图中, 如果两个点 u, v 满足同时存在从 u 到 v 和从 v 到 u 的路径, 则称两个点强连通如果有向图任意两个点强连通, 则称为强连通图. 有向图的极大强连通子图称为强连通分量注意到强连通关系是传递的,所以有向图可以划分为若干不交的强连通分量 例子 有向图的DFS树 代码 下面展示的是洛谷模板 缩点一题的代码 包含强联通分量和拓扑排序两部分 #includebits/stdc.h using namespace std; const int N1000015; int n,m,idx,timestap,top,s; int p[N],head[N],sd[N],dfn[N],low[N]; int sta[N],vis[N]; int h[N],in[N],dist[N]; struct T {int to;int ne;int fr; }edge[N*10],ed[N*10]; void add(int x,int y) {edge[idx].nehead[x];edge[idx].frx;edge[idx].toy;head[x]idx; } void tarjan(int x) {low[x]dfn[x]timestap;sta[top]x;vis[x]1;for (int ihead[x];i;iedge[i].ne){int vedge[i].to;if (!dfn[v]) {tarjan(v);low[x]min(low[x],low[v]);}else if (vis[v]){low[x]min(low[x],low[v]);}}if (dfn[x]low[x]){int y;while (ysta[top--]){sd[y]x;vis[y]0;if (xy) break;p[x]p[y];}} } int topo() {queue int q;int tot0;for (int i1;in;i)if (sd[i]i!in[i]){q.push(i);dist[i]p[i];} while (!q.empty()){int kq.front();q.pop();for (int ih[k];i;ied[i].ne){int ved[i].to;dist[v]max(dist[v],dist[k]p[v]);in[v]--;if (in[v]0) q.push(v);}}int ans0;for (int i1;in;i)ansmax(ans,dist[i]);return ans; } int main() {scanf(%d%d,n,m);for (int i1;in;i)scanf(%d,p[i]);int u,v;for (int i1;im;i){scanf(%d%d,u,v);add(u,v);}for (int i1;in;i)if(!dfn[i])tarjan(i);for (int i1;im;i){int xsd[edge[i].fr],ysd[edge[i].to];if (x!y){ed[s].neh[x];ed[s].toy;ed[s].frx;h[x]s;in[y];}}int anstopo();printf(%d\n,ans);return 0; }例题讲解 [POI2008] BLO-Blockade 题面翻译 B 城有 n n n 个城镇 m m m 条双向道路。 每条道路连结两个不同的城镇没有重复的道路所有城镇连通。 把城镇看作节点把道路看作边容易发现整个城市构成了一个无向图。 请你对于每个节点 i i i 求出把与节点 i i i 关联的所有边去掉以后不去掉节点 i i i 本身无向图有多少个有序点 ( x , y ) (x,y) (x,y)满足 x x x 和 y y y 不连通。 【输入格式】 第一行包含两个整数 n n n 和 m m m。 接下来 m m m 行每行包含两个整数 a a a 和 b b b表示城镇 a a a 和 b b b 之间存在一条道路。 【输出格式】 输出共 n n n 行每行输出一个整数。 第 i i i 行输出的整数表示把与节点 i i i 关联的所有边去掉以后不去掉节点 i i i 本身无向图有多少个有序点 ( x , y ) (x,y) (x,y)满足 x x x 和 y y y 不连通。 【数据范围】 n ≤ 100000 n\le 100000 n≤100000 m ≤ 500000 m\le500000 m≤500000 题目描述 There are exactly n n n towns in Byteotia. Some towns are connected by bidirectional roads. There are no crossroads outside towns, though there may be bridges, tunnels and flyovers. Each pair of towns may be connected by at most one direct road. One can get from any town to any other-directly or indirectly. Each town has exactly one citizen. For that reason the citizens suffer from loneliness. It turns out that each citizen would like to pay a visit to every other citizen (in his host’s hometown), and do it exactly once. So exactly n ⋅ ( n − 1 ) n\cdot (n-1) n⋅(n−1) visits should take place. That’s right, should. Unfortunately, a general strike of programmers, who demand an emergency purchase of software, is under way. As an act of protest, the programmers plan to block one town of Byteotia, preventing entering it, leaving it, and even passing through. As we speak, they are debating which town to choose so that the consequences are most severe. Task Write a programme that: reads the Byteotian road system’s description from the standard input, for each town determines, how many visits could take place if this town were not blocked by programmers, writes out the outcome to the standard output. 给定一张无向图求每个点被封锁之后有多少个有序点对(x,y)(x!y,1x,yn)满足x无法到达y 输入格式 In the first line of the standard input there are two positive integers: n n n and m m m ( 1 ≤ n ≤ 100 000 1\le n\le 100\ 000 1≤n≤100 000, 1 ≤ m ≤ 500 000 1\le m\le 500\ 000 1≤m≤500 000) denoting the number of towns and roads, respectively. The towns are numbered from 1 to n n n. The following m m m lines contain descriptions of the roads. Each line contains two integers a a a and b b b ( 1 ≤ a b ≤ n 1\le ab\le n 1≤ab≤n) and denotes a direct road between towns numbered a a a and b b b. 输出格式 Your programme should write out exactly n n n integers to the standard output, one number per line. The i t h i^{th} ith line should contain the number of visits that could not take place if the programmers blocked the town no. i i i. 样例 #1 样例输入 #1 5 5 1 2 2 3 1 3 3 4 4 5样例输出 #1 8 8 16 14 8思路 魔改一下 tarjan 求割点的过程。 AC代码 #includebits/stdc.h using namespace std; const int N1000010; int n,m,h[N],idx; int dfn[N],low[N],siz[N],tot; long long ans[N]; bool cut[N]; int e[N],ne[N]; inline void add(int u,int v){e[idx]v;ne[idx]h[u];h[u]idx; } void tarjan(int u){dfn[u]low[u]tot;siz[u]1;int flag0,sum0;for(int ih[u];i;ine[i]){int ve[i];if(!dfn[v]){tarjan(v);siz[u]siz[v];low[u]min(low[u],low[v]);if(low[v]dfn[u]){ans[u](long long)siz[v]*(n-siz[v]);sumsiz[v];flag;if(u!1||flag1) cut[u]true;}}else low[u]min(low[u],dfn[v]);}if(!cut[u]) ans[u]2*(n-1);else ans[u](long long)(n-sum-1)*(sum1)(n-1); } int main(){ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cinnm;for(int i1;im;i){int x,y;cinxy;add(x,y);add(y,x);}tarjan(1);for(int i1;in;i)coutans[i]endl;return 0; }【模板】割点割顶 题目背景 割点 题目描述 给出一个 n n n 个点 m m m 条边的无向图求图的割点。 输入格式 第一行输入两个正整数 n , m n,m n,m。 下面 m m m 行每行输入两个正整数 x , y x,y x,y 表示 x x x 到 y y y 有一条边。 输出格式 第一行输出割点个数。 第二行按照节点编号从小到大输出节点用空格隔开。 样例 #1 样例输入 #1 6 7 1 2 1 3 1 4 2 5 3 5 4 5 5 6样例输出 #1 1 5提示 对于全部数据 1 ≤ n ≤ 2 × 1 0 4 1\leq n \le 2\times 10^4 1≤n≤2×104 1 ≤ m ≤ 1 × 1 0 5 1\leq m \le 1 \times 10^5 1≤m≤1×105。 点的编号均大于 0 0 0 小于等于 n n n。 tarjan图不一定联通。 思路 个点就是去掉这个点之后图中的强联通分量变多了那么这个点就是一个割点 因为这样假设割点左边有一个子图右边也有一个子图由于这个点是割点那么左右一定是没有其他边联通的 所以该点的联通的连v满足low[v]dfn[u]最后特判一下根 AC代码 #includebits/stdc.h using namespace std; const int N 1e610; vectorint g[N1]; int n,m,ind[N],low[N],dfn[N],ans,s,ans1[N],tot,num,cut[N],vis[N],now,root; void tarjan(int u){low[u]dfn[u]now,vis[u]1;for(int i0;ig[u].size();i){int vg[u][i];if(!dfn[v]){tarjan(v);if(uroot) s;else{low[u]min(low[u],low[v]);if(low[v]dfn[u]) cut[u]1;}}elselow[u]min(low[u],dfn[v]);} } int main() {ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);cinnm;for(int i1,u,v;im;i){cinuv;g[u].push_back(v);g[v].push_back(u);}for(int i1;in;i){s0;if(dfn[i]) continue;rooti,now0;tarjan(i);ind[i]s; } for(int i1;in;i)if(ind[i]1)ans1[tot]i;for(int i1;in;i){ if(ind[i]!0)continue;if(cut[i]1)ans1[tot]i;}sort(ans11,ans1tot1);couttotendl;for(int i1;itot;i) coutans1[i] ; }这是我的第二十二篇文章如有纰漏也请各位大佬指正 辛苦创作不易还望看官点赞收藏打赏后续还会更新新的内容。
http://www.dnsts.com.cn/news/240065.html

相关文章:

  • 佛山北京网站建设公司哪家好品牌网站建设解决方案
  • 10元建站cms+wordpress模板
  • 个人姓名最多备案多少个网站wordpress去掉title前空格及keywords最后的逗号
  • seo快速优化软件网站建设推广网站
  • 怎么建设银行网站注册优帮云首页推荐
  • asp网站没有数据库连接国内最大的网页模板网站
  • 网站建设维护课件ppt阿里云可以建设多个网站
  • 如何建设网站 知乎常州网站建设方案书
  • 上海建设局网站首页哈尔滨市建设厅网站
  • 网站集约化建设的优点wordpress 获取首页
  • 搭建网站平台如何做分录中国芯片三巨头
  • 建公司网站要多久大连网站制作最好的公司
  • 个人简历空白表可编辑防控政策优化
  • 怎么设计门户网站2021网站建设前景怎么样
  • 做网站ui阿里巴巴做网站找谁
  • php的网站电子商务有限公司网站
  • 营销型网站哪家做的好wordpress对配置的要求
  • 网站 备案 注销 影响品牌授权书模板
  • 备案信息修改网站名称建筑设计图纸
  • 服务高端网站建设单位建设网站需要的材料
  • 公司网站建设价格贵阳网站开发招聘
  • 为什么网站开发成本高荥阳市
  • 联邦快递网站建设的目标网站设计开发网站
  • 生产企业做网站有用吗wordpress做x站主题
  • 新农村建设投诉网站禁止下载app网站
  • 网站开发验收确 认书免费seo网站诊断
  • 工业设计相关网站网站改版效果图怎么做
  • 计算机应用技术 网站开发网站需备案吗
  • 简单网站响应式网站制作
  • 手机版网站建设费用清单怎么制作自己的网站