[CF]Cycling City
题目大意:给定一张无向图,问图中是否存在两个点,使得这两个点之间有三条路径,而且三条路径没有公共点。
解法:
我们可以先走出来一个环,再出环上任意一点走到另外一点。就像这样:
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAArsAAAGCCAIAAABvnJwtAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAABfJSURBVHhe7dvbgfPIcYBRx+WAnIneHYYjcDIORpZGH/SDS2JAzvDSDZzzpq4CyWFd2Fqt/uPvAAB73BgAgH1uDADAPjcGAGCfGwMAsM+NAQDY58YAAOxzYwAA9rkxAAD73BgAgH1uDADAPjcGAGCfGwMAsM+NAQDY58YAAOxzYwAA9rkxAAD73BgAgH1uDADAPjcGAGCfGwMAsM+NAQDY58YAAOxzYwAA9rkxAAD73BgAgH1uDADAPjcGAGCfGwMAsM+NAU7hP16stwGOy5zD3PrFnkQfGpiQAYYJ9Ht7aP2pwKhMKYyl30++9KUAAzCQ8GH9NnKHvjLgE0wgvFU/fe/Ve79Yb/ZevTfweuYNXqtftpfpbSbRh36Z3gZ4AQMGz9fP1/P0uofWn/pUvTTwDCYKnqPfqGfoFU+vr+MZekXgFwwS/Fw/R7/Ta3GHvrLf6bWABxkeeEw/O7/QC/FrfaG/0AsBdzAwsK+flx/pJXiLvvQf6SWADYYENvVL8rie56MqxuN6HrhkNuCv+t14UA8zpIr0oB4GvhgJSL8SD+phJlHZHtTDcG4mgbPrN+ERPcnkKucjehJOyQBwUv0C3K3HOKjKfLcegzPR95xOK/8+PcNpVPi79RicgHbnLFrw9+kZTqxWuE/PwKFpdA6ujX6fnoGVmuM+PQNHpL85rFb4HXoAvlW73KEH4Fh0NgfU2t5TNjyoBtpTNhyFnuZQWtXfKhV+rZbaUzZMTitP5n/+53/+9re/9R9YtJj3lA1PVXvtKRumpYkn84/rgtWz9q9d/L1S4cVquG+VChPSvsyqBfytUuGNar5vlQpT0bhMpo27p2z4kBpxT9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D29J6y4UE10J6y4Sj0NIfV2r5DD8C3apc79AAci87m4Frh9+kZWKk57tMzcET6m1Nond+txzixWuFuPQbHpcs5l7b73XqM06jwd+sxOAHtzkm17+/WYxxUZb5bj8GZ6HvOrl+AR/Qk86uid+sxOCUDAOk34RE9yVQq3iN6Es7NJMBf9SvxoB5mSBXpQT0MfDESsKnfjcf1PB9VMR7X88AlswH7+iX5kV6Ct+hL/5FeAthgSOAx/bz8Qi/EM/Sd/lSvAtzBwMDP9bPzO70Wd+gr+51eC3iQ4YHn6Ofo13o5vvSl/FovB/yCQYIn6zfqqXrpQ+tPfapeGngGEwWv1W/Xa/QeU+mjv0bvAbyAAYO36pftvXrvF+vN3qv3Bl7PvMEn9bvH3frigLczfjCWfhj50pcCDMBAwgT6/Ty0/lRgVKYUJtaP7VT66MBsTC8cX7/Vr9Q7AcdlzgGAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMA+NwYAYJ8bAwCwz40BANjnxgAA7HNjAAD2uTEAAPvcGACAfW4MAMCev//9/wHI9AiXPKDorQAAAABJRU5ErkJgggA=" alt="" width="439" height="242" />
这种图有什么性质?有环。
这是什么图我们可能不知道,但是我们知道这不是什么图啊!这张图一定不是仙人掌!
然后就是如何判断仙人掌和如何输出答案的问题了
参考了这个大佬的博客,我们了解到,可以利用返祖边来判断仙人掌
显然仙人掌中的一条边不能同时出现两个环内
正如大佬所说的“如果一条树边被两条或者以上的返祖边覆盖,那么图就肯定不是一个仙人掌”
我们建出DFS树,可以发现,第一条返祖边能确定一个环,而第二条返祖边能确定三条路径的起点和终点
设起点深度小,终点深度大,我们可以发现终点是两个返祖边中深度最大的两个点的LCA
而起点则是第二条返祖边上深度最大的点与DFS树上一点相连接的一点
然后再xjbDFS一下输出路径即可代码:
#include<iostream>
#include<cstdio>
#include<cstring>
#define M 200010
using namespace std;
struct point{
int to,next;
}e[M<<];
int n,m,num,top,l1,l2,r1,r2,S,T;
int ans[M],head[M],deep[M],f[M];
int fa[M][];
bool vis[M];
void add(int from,int to)
{
e[++num].next=head[from];
e[num].to=to;
head[from]=num;
}
void dfs(int x)
{
vis[x]=true;
for(int i=head[x];i;i=e[i].next)
{
int to=e[i].to;
if(to==fa[x][]) continue;
if(!vis[to])
{
deep[to]=deep[x]+;
fa[to][]=x;
dfs(to);
}
else if(deep[to]<deep[x])//返祖
{
f[to]--;
f[x]++;
}
}
f[fa[x][]]+=f[x];
}
void DFS(int x)
{
for(int i=head[x];i;i=e[i].next)
{
int to=e[i].to;
if(to==fa[x][]) continue;
if(deep[to]==deep[x]+)
{
DFS(to);
if(l2) return;
}
else if(deep[to]<deep[S])//找到两条返祖边
{
if(l1) r2=x,l2=to;
else r1=x,l1=to;
if(l2) return;
}
}
}
int lca(int x,int y)
{
if(deep[x]<deep[y]) swap(x,y);
for(int i=;i>=;i--)
if(deep[fa[x][i]]>=deep[y])
x=fa[x][i];
if(x==y) return y;
for(int i=;i>=;i--)
if(fa[x][i]!=fa[y][i])
{
x=fa[x][i];
y=fa[y][i];
}
return fa[x][];
}
int main()
{
scanf("%d%d",&n,&m);
for(int i=;i<=m;i++)
{
int x,y; scanf("%d%d",&x,&y);
add(x,y); add(y,x);
}
for(int i=;i<=n;i++)
if(!vis[i])
dfs(i);
for(int i=;i<=n;i++)
if(f[i]>)
{
S=i;
break;
}
if(S==) {printf("NO"); return ;}
printf("YES\n");
DFS(S);
for(int j=;j<=;j++)
for(int i=;i<=n;i++)
fa[i][j]=fa[fa[i][j-]][j-];
T=lca(r1,r2);
if(deep[l1]<deep[l2]) swap(l1,l2),swap(r1,r2);
S=l1;
int now=T;
top=;
while()
{
ans[++top]=now;
if(now==S) break;
now=fa[now][];
}
printf("%d ",top);
for(int i=top;i>=;i--) printf("%d ",ans[i]);
printf("\n");
top=;
ans[++top]=S;
now=r1;
while()
{
ans[++top]=now;
if(now==T) break;
now=fa[now][];
}
printf("%d ",top);
for(int i=;i<=top;i++) printf("%d ",ans[i]);
printf("\n");
top=;
if(S==l2)
{
ans[++top]=S;
now=r2;
while()
{
ans[++top]=now;
if(now==T) break;
now=fa[now][];
}
}
else
{
now=S;
while()
{
ans[++top]=now;
if(now==l2) break;
now=fa[now][];
}
now=r2;
while()
{
ans[++top]=now;
if(now==T) break;
now=fa[now][];
}
}
printf("%d ",top);
for(int i=;i<=top;i++) printf("%d ",ans[i]);
return ;
}
[CF]Cycling City的更多相关文章
- 「CF521E」 Cycling City
「CF521E」 Cycling City 传送门 首先你能发现这个东西一定是两个环的公共边. 最开始想的是什么如果一个点被访问过三次那它一定是公共边的某一端之类的东西,然后发现被仙人掌叉掉. 然后就 ...
- Cycling City CF521E
Cycling City 毒瘤题 首先建dfs树,由于是个无向图所有返祖边都是连向祖先的. 判是否有解其实很简单,只要图不是一个仙人掌就有解了. 仙人掌有关可以看这个博客 但是这道题由于要输出路径成功 ...
- Codeforces 521 E cycling city
cf的一道题,非常有意思,题目是问图中是否存在两个点,使得这两个点之间有三条路径,而且三条路径没有公共点. 其实就是判断一下是否为仙人掌就行了,如果不是仙人掌的话肯定就存在,题目难在输出路径上,改了半 ...
- Codeforces 521E - Cycling City(点双连通分量+分类讨论)
Codeforces 题面传送门 & 洛谷题面传送门 大家都是暴力找生成树然后跳路径,代码不到 50 行(暴论)的一说--好,那本蒟蒻决定提供一种代码 150 行,但复杂度也是线性的分类讨论做 ...
- Cassandra 的数据存储结构——本质是SortedMap<RowKey, SortedMap<ColumnKey, ColumnValue>>
Cassandra 的数据存储结构 Cassandra 的数据模型是基于列族(Column Family)的四维或五维模型.它借鉴了 Amazon 的 Dynamo 和 Google's BigTab ...
- URAL 1966 Cycling Roads 点在线段上、线段是否相交、并查集
F - Cycling Roads Description When Vova was in Shenzhen, he rented a bike and spent most of the ...
- BZOJ1628: [Usaco2007 Demo]City skyline
1628: [Usaco2007 Demo]City skyline Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 256 Solved: 210[Su ...
- (中等) CF 576D Flights for Regular Customers (#319 Div1 D题),矩阵快速幂。
In the country there are exactly n cities numbered with positive integers from 1 to n. In each city ...
- [cf contest697] D - Puzzles
[cf contest697] D - Puzzles time limit per test 1 second memory limit per test 256 megabytes input s ...
随机推荐
- Linux下RPM包管理
概述 一种用于互联网下载包的打包及安装工具,它包含在某些linux分发版中.它生成具有.RPM扩展名的文件.RPM是Redhat Package Manager(Redhat软件包管理工具)的缩写.这 ...
- JAVA基础面试(五5)
41.a.hashCode() 有什么用?与 a.equals(b) 有什么关系? hashCode() 方法对应对象整型的 hash 值.它常用于基于 hash 的集合类,如 Hash ...
- poj1325(Machine Schedule)
题目链接:传送门 题目大意:有k个任务,可以在 A 机器的 x 位上完成,也可以在 B 机器的 y 位上完成.问最少需要多少个点位即可完成所有任务. 题目思路:求最小点覆盖. 把 A 机器,B 机器看 ...
- jQuery.ajax jQuery.post
$.ajax()函数依赖服务器提供的信息来处理返回的数据.如果服务器报告说返回的数据是XML,那么返回的结果就可以用普通的XML方法或者jQuery的选择器来遍历.如果见得到其他类型,比如HTML,则 ...
- 并发测试 java.lang.OutOfMemoryError: GC overhead limit exceeded Xms Xmx 阻塞请求 单节点 请求分发 负载均衡
at javax.servlet.http.HttpServlet.service(HttpServlet.java:705) at javax.servlet.http.HttpServlet.se ...
- <2014 04 26> 《Coders at Work编程人生:15位软件先驱访谈录》
什么是老派程序员?调试只用printf,关心数据结构,先整体或先局部,不知道OO.IDE.TDD.BDD等等为何物.Ken Thompson,Jamie Zawinski,Joe Armstrong, ...
- 深入理解Mysql索与事务隔离级别
1. 概述 1.1 定义 锁是计算机协调多个进程或线程并发访问某一资源的机制. 在数据库中,除了传统的计算资源(如CPU.RAM.I/O等)的争用以外,数据也是一种供需要用户共享的资源.如何保证数据并 ...
- delphi 模拟POST提交数据
unit GetHttpInfo; interface uses Classes, WinINet, Sysutils, windows, IDURI, IdSSLOpenSSL , IdBaseCo ...
- 手动拼写出来的sp_who结果集
SELECT SPID = er.session_id ,STATUS = ses.STATUS ,[Login] = ses.login_name ,Host = ses.host_name ...
- django--个人主页建立练习
1.前端页面采用模板继承与动态模板 {% extends 'base.html' %} {% block content %} {% for article in article_list %} &l ...