結果
| 問題 | No.582 キャンディー・ボックス3 |
| コンテスト | |
| ユーザー |
ats5515
|
| 提出日時 | 2017-10-27 22:28:10 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 750 bytes |
| 記録 | |
| コンパイル時間 | 568 ms |
| コンパイル使用メモリ | 103,132 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-16 13:11:05 |
| 合計ジャッジ時間 | 1,530 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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;
}
ats5515