結果

問題 No.583 鉄道同好会
ユーザー uafr_csuafr_cs
提出日時 2017-11-03 21:44:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 2,305 ms
コンパイル使用メモリ 74,752 KB
実行使用メモリ 63,852 KB
最終ジャッジ日時 2024-05-02 04:58:00
合計ジャッジ時間 10,301 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
54,292 KB
testcase_01 AC 134 ms
53,876 KB
testcase_02 AC 137 ms
54,136 KB
testcase_03 AC 137 ms
53,964 KB
testcase_04 WA -
testcase_05 AC 144 ms
54,240 KB
testcase_06 AC 137 ms
54,076 KB
testcase_07 AC 138 ms
54,332 KB
testcase_08 AC 142 ms
54,108 KB
testcase_09 AC 143 ms
54,104 KB
testcase_10 AC 180 ms
54,228 KB
testcase_11 AC 469 ms
59,064 KB
testcase_12 AC 575 ms
59,332 KB
testcase_13 AC 570 ms
59,124 KB
testcase_14 AC 538 ms
59,380 KB
testcase_15 AC 670 ms
59,568 KB
testcase_16 AC 830 ms
63,100 KB
testcase_17 AC 895 ms
63,852 KB
testcase_18 AC 858 ms
63,636 KB
権限があれば一括ダウンロードができます

ソースコード

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("NO");
		}
	}
}
0