結果
問題 | No.583 鉄道同好会 |
ユーザー | uafr_cs |
提出日時 | 2017-11-03 22:06:43 |
言語 | Java21 (openjdk 21) |
結果 |
WA
|
実行時間 | - |
コード長 | 663 bytes |
コンパイル時間 | 2,299 ms |
コンパイル使用メモリ | 71,664 KB |
実行使用メモリ | 64,700 KB |
最終ジャッジ日時 | 2023-08-14 16:49:37 |
合計ジャッジ時間 | 9,320 ms |
ジャッジサーバーID (参考情報) |
judge15 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 130 ms
55,436 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | AC | 125 ms
55,884 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 126 ms
55,740 KB |
testcase_07 | AC | 126 ms
55,544 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
testcase_11 | WA | - |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | WA | - |
testcase_17 | WA | - |
testcase_18 | AC | 748 ms
64,700 KB |
ソースコード
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"); } } }