結果

問題 No.582 キャンディー・ボックス3
ユーザー square1001
提出日時 2018-01-21 16:57:38
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 458 bytes
コンパイル時間 865 ms
コンパイル使用メモリ 83,252 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-25 21:17:06
合計ジャッジ時間 1,744 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
using namespace std;
int n, a;
int main() {
	cin >> n;
	int c2 = 0, c3 = 0; long long cnt = 0;
	for (int i = 0; i < n; i++) {
		cin >> a;
		cnt += a;
		if (a >= 2) c2++;
		if (a >= 3) c3++;
	}
	if (cnt % 2 == 0) cout << "B" << endl;
	else if (c2 >= 2 || c3 >= 1) cout << "B" << endl;
	else cout << "A" << endl;
	return 0;
}
0