一笔画问题
KB
- 描述
-
zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。
规定,所有的边都只能画一次,不能重复画。
简单的欧拉图的问题,注意要先去判断是否是连通图
package 一笔画;
import java.util.Scanner;
public class DrawAtOnce {
static void main(String[] args) {
DrawAtOnce drawAtOnce = new DrawAtOnce();
drawAtOnce.solution();
solution() {
Scanner(System.in);
in.nextInt();
0; i < groups; i++) {
getDate();
if(handle()){
System.out.println("Yes");
System.out.println("No");
in;
vertexs;
Lines;
vertexList;
root;
getroot(int i){
!= i){
root[i] = root[root[i]];
i;
getDate(){
in.nextInt();
in.nextInt();
new int[vertexs+1];
int[vertexs+1];
; i <= vertexs;i++){
i;
=