#include<iostream>
#include<stdio.h>
#include<vector>
using namespace std;
const int maxn=100010;
int head[maxn],ver[maxn*2],Next[maxn*2];
int dfn[maxn],low[maxn],sta[maxn];
int n,m,tot,num,root;
bool cut[maxn];
void add(int x,int y)
{
ver[++tot]=y;
Next[tot]=head[x];
head[x]=tot;
}
void tarjan(int x)
{
dfn[x]=low[x]=++num;
int flag=0;
for(int i=head[x];i;i=Next[i])
{
int y=ver[i];
if(!dfn[y])
{
tarjan(y);
low[x]=min(low[x],low[y]);
if(low[y]>=dfn[x])
{
flag++;
if(x!=root||flag>1) cut[x]=1;
}
}
else low[x]=min(low[x],dfn[y]);
}
}
int main()
{
cin>>n>>m;
tot=1;
for(int i=1;i<=m;i++)
{
int x,y;
scanf("%d %d",&x,&y);
if(x==y) continue;
add(x,y),add(y,x);
}
for(int i=1;i<=n;i++)
{
if(!dfn[i]) root=i,tarjan(i);
}
for(int i=1;i<=n;i++)
if(cut[i]) printf("%d ",i);
}

最新文章

  1. 三维网格分割算法(Random Walks)
  2. HttpClientHandler
  3. iOS开发中GCD在多线程方面的理解
  4. asp.net mvc Remote远程验证
  5. 图画(txt等一下)实施开放的默认下载的默认浏览器,而不是(Java文本)
  6. css3中display和box小结
  7. redis 队列缓存 + mysql 批量入库 + php 离线整合
  8. CentOS安装Nginx 报错“configure: error: the HTTP rewrite module requires the PCRE library”解决办法
  9. xShell终端下中文乱码问题
  10. 推荐系统——online(上)
  11. 阅读源码(III)
  12. PA 模块常用表2
  13. HashMap扩容全过程
  14. 从ranknet到lamdarank,再到lamdamart
  15. SSRS表达式里引用.net dll
  16. git 服务器安装流程
  17. Git 使用篇二:搭建远程服务器
  18. Dubbo配置优化
  19. Leetcode题库——28.实现strStr()
  20. annotation-config和component-scan

热门文章

  1. js实现表单的隔行换色、鼠标高亮出来等相关内容以及相关事件的作用
  2. 29.2 Iterator 迭代器
  3. 条件变量 condition_variable wait_until
  4. WEB应用环境的搭建(一)配置Tomcat步骤
  5. 2019应届生,用python爬虫记录自己求职经历,分享求职中的一些坑
  6. mysql定期任务
  7. 数据结构与算法--二分搜索(binary search)
  8. linux CVE-2019-13272 本地特权漏洞
  9. Springboot:员工管理之修改员工(十(8))
  10. 实现Nginx Upload 模块 功能上传文件。