結果

問題 No.1716 Bonus Nim
ユーザー ks2mks2m
提出日時 2021-10-22 21:36:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 759 bytes
コンパイル時間 1,872 ms
コンパイル使用メモリ 74,832 KB
実行使用メモリ 79,696 KB
最終ジャッジ日時 2023-10-24 12:33:37
合計ジャッジ時間 12,012 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
52,644 KB
testcase_01 AC 53 ms
52,640 KB
testcase_02 AC 52 ms
53,580 KB
testcase_03 AC 53 ms
53,576 KB
testcase_04 AC 450 ms
77,900 KB
testcase_05 AC 430 ms
75,832 KB
testcase_06 AC 422 ms
72,972 KB
testcase_07 AC 421 ms
75,452 KB
testcase_08 AC 434 ms
76,420 KB
testcase_09 AC 428 ms
78,280 KB
testcase_10 AC 420 ms
75,652 KB
testcase_11 AC 491 ms
78,196 KB
testcase_12 AC 486 ms
71,396 KB
testcase_13 AC 459 ms
75,548 KB
testcase_14 AC 442 ms
71,496 KB
testcase_15 AC 465 ms
65,164 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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

			int x = 0;
			for (int i = 0; i < n; i++) {
				x ^= a[i];
			}
			if (n % 2 == 0 && x == 0) {
				pw.println("Bob");
			} else {
				pw.println("Alice");
			}
		}
		br.close();
		pw.flush();
	}
}
0