結果

問題 No.583 鉄道同好会
ユーザー uafr_csuafr_cs
提出日時 2017-11-03 22:08:11
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 644 bytes
コンパイル時間 2,032 ms
コンパイル使用メモリ 72,452 KB
実行使用メモリ 64,960 KB
最終ジャッジ日時 2023-08-14 16:50:24
合計ジャッジ時間 8,559 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 100 ms
55,992 KB
testcase_01 AC 100 ms
55,676 KB
testcase_02 AC 103 ms
55,800 KB
testcase_03 AC 100 ms
56,024 KB
testcase_04 AC 101 ms
55,988 KB
testcase_05 AC 100 ms
55,512 KB
testcase_06 WA -
testcase_07 AC 104 ms
55,784 KB
testcase_08 AC 103 ms
55,936 KB
testcase_09 AC 107 ms
56,016 KB
testcase_10 AC 143 ms
55,920 KB
testcase_11 AC 328 ms
60,116 KB
testcase_12 AC 389 ms
60,100 KB
testcase_13 AC 392 ms
60,224 KB
testcase_14 AC 393 ms
60,360 KB
testcase_15 AC 430 ms
60,740 KB
testcase_16 AC 528 ms
63,244 KB
testcase_17 AC 552 ms
64,864 KB
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

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