結果

問題 No.582 キャンディー・ボックス3
ユーザー GrenacheGrenache
提出日時 2017-10-27 23:01:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 857 bytes
コンパイル時間 3,247 ms
コンパイル使用メモリ 74,816 KB
実行使用メモリ 56,324 KB
最終ジャッジ日時 2024-05-01 17:19:23
合計ジャッジ時間 6,712 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 126 ms
41,180 KB
testcase_04 AC 114 ms
41,196 KB
testcase_05 AC 126 ms
41,200 KB
testcase_06 WA -
testcase_07 AC 125 ms
41,660 KB
testcase_08 AC 125 ms
41,564 KB
testcase_09 AC 131 ms
41,460 KB
testcase_10 AC 134 ms
41,412 KB
testcase_11 AC 129 ms
41,432 KB
testcase_12 WA -
testcase_13 AC 134 ms
41,356 KB
testcase_14 AC 140 ms
41,604 KB
testcase_15 AC 137 ms
41,448 KB
testcase_16 AC 140 ms
41,432 KB
testcase_17 AC 148 ms
41,628 KB
testcase_18 AC 141 ms
41,176 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) {
			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