結果

問題 No.582 キャンディー・ボックス3
ユーザー GrenacheGrenache
提出日時 2017-10-27 23:18:57
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 916 bytes
コンパイル時間 3,145 ms
コンパイル使用メモリ 77,860 KB
実行使用メモリ 54,180 KB
最終ジャッジ日時 2024-05-01 17:42:30
合計ジャッジ時間 6,195 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 113 ms
41,328 KB
testcase_04 AC 118 ms
41,460 KB
testcase_05 AC 123 ms
41,380 KB
testcase_06 AC 97 ms
41,396 KB
testcase_07 AC 110 ms
41,576 KB
testcase_08 AC 116 ms
41,116 KB
testcase_09 AC 112 ms
41,460 KB
testcase_10 AC 117 ms
41,252 KB
testcase_11 AC 112 ms
41,392 KB
testcase_12 WA -
testcase_13 AC 123 ms
41,052 KB
testcase_14 AC 116 ms
41,444 KB
testcase_15 AC 130 ms
41,564 KB
testcase_16 AC 128 ms
41,608 KB
testcase_17 AC 124 ms
41,560 KB
testcase_18 AC 126 ms
41,552 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.*;
import java.util.*;


public class Main_yukicoder582 {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int n = sc.nextInt();

		int[] c = new int[n];
		int xor = 0;
		for (int i = 0; i < n; i++) {
			c[i] = sc.nextInt();
			xor ^= c[i];
		}

		if (n == 1) {
			if (c[0] == 1) {
				pr.println('A');
			} else {
				pr.println('B');
			}
		} else {
			xor &= 0x3;

			if (xor == 0) {
				pr.println('B');
			} else if (xor == 1) {
				pr.println('A');
			} else if (xor == 2) {
				pr.println('B');
			} else {
				pr.println('A');
			}
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
0