結果
| 問題 | No.582 キャンディー・ボックス3 | 
| コンテスト | |
| ユーザー |  ats5515 | 
| 提出日時 | 2017-10-27 22:28:10 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 750 bytes | 
| コンパイル時間 | 719 ms | 
| コンパイル使用メモリ | 82,896 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-11-22 10:49:06 | 
| 合計ジャッジ時間 | 1,502 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 17 | 
ソースコード
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N;
	cin >> N;
	vector<int> A(N);
	string res;
	int f = 0;
	int sum = 0;
	int k;
	for (int i = 0; i < N; i++) {
		cin >> A[i];
		if (A[i] >= 2) {
			f++;
			k = A[i];
		}
		sum += A[i];
	}
	if (f > 0) {
		if (f == 1 && k == 2) {
			if ((sum % 2) == 1) {
				res = "A";
			}
			else {
				res = "B";
			}
		}
		else {
			res = "B";
		}
	}
	else {
		if ((sum % 2) == 1) {
			res = "A";
		}
		else {
			res = "B";
		}
	}
	cout << res << endl;
}
            
            
            
        