英语翻译Your task is so easy.I will give you an undirected graph,and you just need to tell me whether the graph is just a circle.A cycle is three or more nodes V1,V2,V3,...Vk,such that there are edges between V1 and V2,V2 and V3,...Vk and V1,with no other extra edges.The graph will not contain self-loop.Furthermore,there is at most one edge between two nodes.InputThere are multiple cases (no more than 10).The first line contains two integers n and m,which
问题描述:
英语翻译
Your task is so easy.I will give you an undirected graph,and you just need to tell me whether the graph is just a circle.A cycle is three or more nodes V1,V2,V3,...Vk,such that there are edges between V1 and V2,V2 and V3,...Vk and V1,with no other extra edges.The graph will not contain self-loop.Furthermore,there is at most one edge between two nodes.
Input
There are multiple cases (no more than 10).
The first line contains two integers n and m,which indicate the number of nodes and the number of edges (1
扫码下载作业帮
拍照答疑一拍即得
答
你的任务很简单.我会给你一个无向图,你需要告诉我这个图标是否仅仅是个圆圈.一个圆圈有3个或3个以上的节点V1,V2,V3……Vk等等,这样一来,V1与V2,V2与V3,……Vk与V1间就会有很多条棱,并且不会有多余的棱.这个图标不会有自循环,两个节点间最多有一条棱.
输入
有很多种情况(不超过10)
第一条线包含两个整数n和m,表明节点的数量和节点之间棱的数量(1