結果

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

ソースコード

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("NO");
		}else{
			System.out.println("NO");
		}
	}
}
0