結果
| 問題 | No.582 キャンディー・ボックス3 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-23 01:08:59 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 686 bytes |
| 記録 | |
| コンパイル時間 | 669 ms |
| コンパイル使用メモリ | 80,508 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-23 01:09:01 |
| 合計ジャッジ時間 | 1,798 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 14 WA * 3 |
ソースコード
#include <iostream>
using namespace std;
int n, one, two, three;
void Solve() {
one = two = 0;
scanf("%d", &n);
if (n == 1) {
int x;
scanf("%d", &x);
puts(x == 1 ? "A" : "B");
} else {
for (int i = 1, x; i <= n; ++i) {
scanf("%d", &x);
if (x == 1) ++one;
else if (x == 2) ++two;
else three = true;
}
if (three || two >= 2) puts("B");
else {
if (two == 1) one += 2;
puts(one % 2 ? "A" : "B");
}
}
}
int main() {
// freopen("game.in", "r", stdin);
// freopen("game.out", "w", stdout);
Solve();
return 0;
}