結果

問題 No.582 キャンディー・ボックス3
ユーザー GrenacheGrenache
提出日時 2017-10-27 23:07:20
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 796 bytes
コンパイル時間 3,946 ms
コンパイル使用メモリ 75,360 KB
実行使用メモリ 41,628 KB
最終ジャッジ日時 2024-05-01 17:34:12
合計ジャッジ時間 7,965 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 138 ms
41,552 KB
testcase_04 WA -
testcase_05 AC 138 ms
41,348 KB
testcase_06 AC 141 ms
41,000 KB
testcase_07 AC 134 ms
41,348 KB
testcase_08 AC 133 ms
41,256 KB
testcase_09 AC 136 ms
41,244 KB
testcase_10 AC 140 ms
41,200 KB
testcase_11 AC 132 ms
41,236 KB
testcase_12 WA -
testcase_13 AC 145 ms
41,404 KB
testcase_14 AC 146 ms
41,460 KB
testcase_15 AC 147 ms
41,552 KB
testcase_16 AC 143 ms
41,464 KB
testcase_17 AC 147 ms
41,628 KB
testcase_18 AC 156 ms
41,380 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];
		}

		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