結果

問題 No.2666 Decreasing Modulo Nim
ユーザー ks2mks2m
提出日時 2024-03-08 22:39:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 330 ms / 2,000 ms
コード長 720 bytes
コンパイル時間 3,384 ms
コンパイル使用メモリ 74,668 KB
実行使用メモリ 75,752 KB
最終ジャッジ日時 2024-03-08 22:39:50
合計ジャッジ時間 17,141 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
53,988 KB
testcase_01 AC 52 ms
53,988 KB
testcase_02 AC 52 ms
53,992 KB
testcase_03 AC 139 ms
58,020 KB
testcase_04 AC 290 ms
71,820 KB
testcase_05 AC 296 ms
72,128 KB
testcase_06 AC 120 ms
58,068 KB
testcase_07 AC 324 ms
68,640 KB
testcase_08 AC 195 ms
59,896 KB
testcase_09 AC 299 ms
75,752 KB
testcase_10 AC 263 ms
67,264 KB
testcase_11 AC 211 ms
61,660 KB
testcase_12 AC 157 ms
60,880 KB
testcase_13 AC 209 ms
64,104 KB
testcase_14 AC 155 ms
60,896 KB
testcase_15 AC 292 ms
68,736 KB
testcase_16 AC 167 ms
61,796 KB
testcase_17 AC 207 ms
64,188 KB
testcase_18 AC 260 ms
66,928 KB
testcase_19 AC 231 ms
64,480 KB
testcase_20 AC 218 ms
64,256 KB
testcase_21 AC 304 ms
71,700 KB
testcase_22 AC 149 ms
60,692 KB
testcase_23 AC 147 ms
60,560 KB
testcase_24 AC 181 ms
61,112 KB
testcase_25 AC 183 ms
58,728 KB
testcase_26 AC 277 ms
67,312 KB
testcase_27 AC 222 ms
64,244 KB
testcase_28 AC 281 ms
71,724 KB
testcase_29 AC 267 ms
67,352 KB
testcase_30 AC 297 ms
72,496 KB
testcase_31 AC 255 ms
67,524 KB
testcase_32 AC 261 ms
67,244 KB
testcase_33 AC 309 ms
70,768 KB
testcase_34 AC 136 ms
57,836 KB
testcase_35 AC 298 ms
69,992 KB
testcase_36 AC 256 ms
67,708 KB
testcase_37 AC 329 ms
69,288 KB
testcase_38 AC 298 ms
71,848 KB
testcase_39 AC 138 ms
58,012 KB
testcase_40 AC 325 ms
68,652 KB
testcase_41 AC 239 ms
66,868 KB
testcase_42 AC 234 ms
66,408 KB
testcase_43 AC 54 ms
53,980 KB
testcase_44 AC 53 ms
54,012 KB
testcase_45 AC 294 ms
71,648 KB
testcase_46 AC 292 ms
71,940 KB
testcase_47 AC 306 ms
71,808 KB
testcase_48 AC 299 ms
71,896 KB
testcase_49 AC 284 ms
71,820 KB
testcase_50 AC 299 ms
71,896 KB
testcase_51 AC 330 ms
72,364 KB
testcase_52 AC 284 ms
71,400 KB
testcase_53 AC 325 ms
71,608 KB
testcase_54 AC 306 ms
71,612 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		int m = Integer.parseInt(sa[1]);
		sa = br.readLine().split(" ");
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		int x1 = 0;
		int x2 = 0;
		for (int i = 0; i < n; i++) {
			int v1 = a[i] / m;
			int v2 = a[i] % m;
			x1 ^= v1;
			x2 ^= v2;
		}
		if (x1 == 0 && x2 == 0) {
			System.out.println("Bob");
		} else {
			System.out.println("Alice");
		}
	}
}
0