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

seo流量/win10优化软件哪个好

seo流量,win10优化软件哪个好,做网销好的网站,西部数码做跳转网站题意翻译 题目描述 在Byteotia有n个城镇。 一些城镇之间由无向边连接。 在城镇外没有十字路口,尽管可能有桥,隧道或者高架公路(反正不考虑这些)。每两个城镇之间至多只有一条直接连接的道路。人们可以从任意一个城镇直接或间接到达…

题意翻译

题目描述

在Byteotia有n个城镇。 一些城镇之间由无向边连接。 在城镇外没有十字路口,尽管可能有桥,隧道或者高架公路(反正不考虑这些)。每两个城镇之间至多只有一条直接连接的道路。人们可以从任意一个城镇直接或间接到达另一个城镇。 每个城镇都有一个公民,他们被孤独所困扰。事实证明,每个公民都想拜访其他所有公民一次(在主人所在的城镇)。所以,一共会有n*(n-1)次拜访。

不幸的是,一个程序员总罢工正在进行中,那些程序员迫切要求购买某个软件。

作为抗议行动,程序员们计划封锁一些城镇,阻止人们进入,离开或者路过那里。

正如我们所说,他们正在讨论选择哪些城镇会导致最严重的后果。

编写一个程序:

读入Byteotia的道路系统,对于每个被决定的城镇,如果它被封锁,有多少访问不会发生,输出结果。

输入输出格式

第一行读入n,m,分别是城镇数目和道路数目

城镇编号1~n

接下来m行每行两个数字a,b,表示a和b之间有有一条无向边

输出n行,每行一个数字,为第i个城镇被锁时不能发生的访问的数量。

翻译提供者:Park

题目描述

There are exactly nn 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\cdot (n-1)n(n1) 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,1<=x,y<=n)满足x无法到达y

输入输出格式

输入格式:

In the first line of the standard input there are two positive integers: nn and mm (1\le n\le 100\ 0001n100 000, 1\le m\le 500\ 0001m500 000) denoting the number of towns and roads, respectively.

The towns are numbered from 1 to nn.

The following mm lines contain descriptions of the roads.

Each line contains two integers aa and bb (1\le a<b\le n1a<bn) and denotes a direct road between towns numbered aa and bb.

输出格式:

Your programme should write out exactly nn integers to the standard output, one number per line. The i^{th}ith line should contain the number of visits that could not take place if the programmers blocked the town no. ii.

输入输出样例

输入样例#1: 
5 5
1 2
2 3
1 3
3 4
4 5
输出样例#1:
8
8
16
14
8

分析:
本题就是对每个点进行讨论,判断其是不是割点,分别更新对数,最后遍历一遍求出答案即可。

CODE:
 1 #include <bits/stdc++.h>
 2 using namespace std;
 3 const int maxn = 1e6 + 100;   
 4 typedef long long ull;
 5 typedef pair <int, int > pii;
 6 
 7 inline int read() {
 8     int s = 0, w = 1;
 9     char ch = getchar();
10     while (!isdigit(ch)) { if (ch == '-') w = -1; ch = getchar(); }
11     while (isdigit(ch)) { s = (s << 1) + (s << 3) + (ch ^ 48); ch = getchar(); }
12     return s * w;
13 }
14 
15 int n, m, num_edge = 0, tim = 0;
16 struct Edge { int next, to; } edge[maxn];
17 int head[maxn], low[maxn], dfn[maxn], size[maxn];
18 ull ans[maxn];
19 
20 inline void add(int from, int to) {
21     edge[++num_edge].to = to;
22     edge[num_edge].next = head[from];
23     head[from] = num_edge;
24 }
25 
26 void dfs(int u) {
27     ull sum = 0;
28     size[u] = 1; 
29     dfn[u] = low[u] = ++tim;
30     for (int i = head[u]; i; i = edge[i].next) {
31         int v = edge[i].to;
32         if (!dfn[v]) {
33             dfs(v);
34             size[u] += size[v];
35             low[u] = min(low[u], low[v]);
36             if (low[v] >= dfn[u]) {
37                 ans[u] += sum * size[v]; 
38                 sum += size[v];
39             }
40         }
41         else low[u] = min(low[u], dfn[v]);
42     }
43     ans[u] += sum * (n - sum - 1);
44 }
45 
46 int main() {
47     // freopen("test.in","r",stdin);
48     // freopen("test.out","w",stdout);
49     n = read(), m = read();
50     for (int i = 1; i <= m; ++i) {
51         int a, b;
52         a = read(); b = read();
53         add(a, b);
54         add(b, a);
55     }
56     dfs(1);
57     for (int i = 1; i <= n; ++i) {
58         printf("%lld\n", (ans[i] + n - 1) << 1);
59     }
60     // system("PAUSE");
61     return 0;
62 }
 

转载于:https://www.cnblogs.com/kanchuang/p/11156639.html

http://www.lbrq.cn/news/756199.html

相关文章:

  • 网站的二维码怎么做的/网站推广教程
  • 如何搭建网站/seo网站优化培训怎么做
  • 自助网站免费/百度小说排行榜第一名
  • 坪山手机网站建设/b站新人视频怎么推广
  • 企业做网站被骗/惠州百度seo排名
  • 王悦做网站/seo搜论坛
  • 免费信息网站建设平台/如何优化推广网站
  • 二手房网签合同在哪个网站做/设计外包网站
  • 不会做网站如何做seo/自己怎么建网站
  • 快速优化网站排名搜索/深圳网站制作公司
  • 关于网站建设与维护的参考文献/网络推广外包公司干什么的
  • 免费微网站制作教程视频/seo优化公司哪家好
  • 建设银行善融商务网站装修/百度游戏客服在线咨询
  • 国外建站系统/淘宝seo优化是什么
  • 怎么查网站备案接入商/武汉全网推广
  • 如何做自己网站的seo/精准引流推广团队
  • 我的世界做图的网站/百度公司的业务范围
  • 邢台网站建设服务商/seo点击软件
  • 东莞企业高端网站建设/百度新闻下载安装
  • 做阿里巴巴类似的网站/2022最新小学生新闻
  • 龙岩网站制作教程/湖南seo推广多少钱
  • 苏州网站建设公司找哪家/优化营商环境评价
  • 百度推广网站怎么做/汽车营销活动策划方案
  • 南京网站设计价格/现在推广什么app最挣钱
  • 广东华业建设有限公司网站/怎样把个人介绍放到百度
  • 网站建设电话销售话术模板大全/口碑营销方案
  • 河南专业网站建设公司/网站推广哪个平台最好
  • 重庆建站模板厂家/营销推广seo
  • 电商网站怎么做支付/企业线上培训平台
  • 58同城怎么做网站/seo任务
  • 软件需求管理过程详解
  • 使用openssl创建自签名CA并用它签发服务器证书
  • 浏览器面试题及详细答案 88道(45-55)
  • C语言笔记6:C高级 part1
  • 第二十四天:虚函数与纯虚函数
  • 零基础-动手学深度学习-10.3. 注意力评分函数