結果

問題 No.583 鉄道同好会
ユーザー uafr_csuafr_cs
提出日時 2017-11-03 21:44:45
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 662 bytes
コンパイル時間 2,800 ms
コンパイル使用メモリ 71,916 KB
実行使用メモリ 64,668 KB
最終ジャッジ日時 2023-08-14 16:49:12
合計ジャッジ時間 9,511 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,752 KB
testcase_01 AC 123 ms
55,364 KB
testcase_02 AC 126 ms
55,744 KB
testcase_03 AC 128 ms
55,612 KB
testcase_04 WA -
testcase_05 AC 126 ms
55,300 KB
testcase_06 AC 129 ms
55,896 KB
testcase_07 AC 128 ms
55,356 KB
testcase_08 AC 129 ms
55,656 KB
testcase_09 AC 132 ms
55,856 KB
testcase_10 AC 176 ms
55,836 KB
testcase_11 AC 408 ms
60,492 KB
testcase_12 AC 473 ms
60,344 KB
testcase_13 AC 463 ms
60,224 KB
testcase_14 AC 492 ms
60,528 KB
testcase_15 AC 541 ms
60,292 KB
testcase_16 AC 677 ms
64,460 KB
testcase_17 AC 730 ms
64,492 KB
testcase_18 AC 730 ms
64,668 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