結果

問題 No.582 キャンディー・ボックス3
ユーザー GrenacheGrenache
提出日時 2017-10-27 22:43:49
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 755 bytes
コンパイル時間 3,235 ms
コンパイル使用メモリ 75,072 KB
実行使用メモリ 55,032 KB
最終ジャッジ日時 2024-05-01 16:48:13
合計ジャッジ時間 6,594 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 124 ms
41,340 KB
testcase_04 AC 106 ms
41,140 KB
testcase_05 AC 105 ms
41,248 KB
testcase_06 WA -
testcase_07 AC 118 ms
41,024 KB
testcase_08 AC 114 ms
41,060 KB
testcase_09 AC 114 ms
41,204 KB
testcase_10 AC 106 ms
41,172 KB
testcase_11 AC 120 ms
41,064 KB
testcase_12 WA -
testcase_13 AC 126 ms
41,432 KB
testcase_14 AC 122 ms
41,596 KB
testcase_15 AC 130 ms
41,272 KB
testcase_16 AC 131 ms
41,568 KB
testcase_17 AC 126 ms
41,612 KB
testcase_18 AC 128 ms
41,260 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 {
			if ((xor & 0x1) != 0) {
				pr.println('A');
			} else {
				pr.println('B');
			}
		}
	}

	// ---------------------------------------------------
	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