結果

問題 No.669 対決!!! 飲み比べ
ユーザー takeya_okinotakeya_okino
提出日時 2017-07-15 12:47:50
言語 Java21
(openjdk 21)
結果
AC  
実行時間 192 ms / 2,000 ms
コード長 438 bytes
コンパイル時間 3,685 ms
コンパイル使用メモリ 71,336 KB
実行使用メモリ 55,944 KB
最終ジャッジ日時 2023-09-07 07:40:37
合計ジャッジ時間 8,653 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
55,660 KB
testcase_01 AC 129 ms
55,692 KB
testcase_02 AC 129 ms
55,460 KB
testcase_03 AC 131 ms
55,696 KB
testcase_04 AC 131 ms
55,580 KB
testcase_05 AC 128 ms
55,564 KB
testcase_06 AC 129 ms
53,644 KB
testcase_07 AC 130 ms
55,568 KB
testcase_08 AC 129 ms
55,612 KB
testcase_09 AC 130 ms
55,328 KB
testcase_10 AC 128 ms
55,620 KB
testcase_11 AC 129 ms
55,576 KB
testcase_12 AC 132 ms
55,668 KB
testcase_13 AC 138 ms
55,696 KB
testcase_14 AC 127 ms
55,528 KB
testcase_15 AC 132 ms
55,324 KB
testcase_16 AC 141 ms
55,708 KB
testcase_17 AC 130 ms
53,248 KB
testcase_18 AC 134 ms
55,560 KB
testcase_19 AC 130 ms
55,708 KB
testcase_20 AC 132 ms
55,692 KB
testcase_21 AC 132 ms
55,364 KB
testcase_22 AC 138 ms
55,320 KB
testcase_23 AC 192 ms
55,772 KB
testcase_24 AC 189 ms
55,944 KB
testcase_25 AC 130 ms
55,564 KB
testcase_26 AC 128 ms
55,564 KB
testcase_27 AC 129 ms
55,684 KB
testcase_28 AC 133 ms
55,804 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int[] A = new int[N];
    for(int i = 0; i < N; i++) {
      A[i] = sc.nextInt() % (K + 1);
    }
    int x = 0;
    for(int i = 0; i < N; i++) {
      x = x ^ A[i];
    }
    String ans = "YES";
    if(x == 0) ans = "NO";
    System.out.println(ans);
  }
}
0