結果

問題 No.583 鉄道同好会
ユーザー uafr_cs
提出日時 2017-11-03 22:06:43
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 663 bytes
コンパイル時間 2,301 ms
コンパイル使用メモリ 74,224 KB
実行使用メモリ 65,316 KB
最終ジャッジ日時 2024-11-22 15:49:24
合計ジャッジ時間 10,238 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 4 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Scanner;

public class Main {
	
	public static long MOD = 1000000007;
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final int N = sc.nextInt();
		final int M = sc.nextInt();
		
		int[] degs = new int[N];
		for(int i = 0; i < M; i++){
			final int a = sc.nextInt();
			final int b = sc.nextInt();
			
			degs[a]++;
			degs[b]++;
		}
		
		int odd_count = 0;
		for(int i = 0; i < N; i++){
			if(degs[i] % 2 == 1){ odd_count++; }
		}
		
		if(odd_count == 0 || odd_count == 2){
			System.out.println("YES");
		}else{
			System.out.println("YES");
		}
	}
}
0