結果
| 問題 | No.582 キャンディー・ボックス3 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-23 01:05:42 |
| 言語 | C++17(gcc13) (gcc 13.4.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 629 bytes |
| 記録 | |
| コンパイル時間 | 2,788 ms |
| コンパイル使用メモリ | 72,068 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-23 01:05:50 |
| 合計ジャッジ時間 | 7,392 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | WA * 9 TLE * 1 -- * 7 |
ソースコード
#include <iostream>
using namespace std;
int t, n;
int main() {
// freopen("game.in", "r", stdin);
// freopen("game.out", "w", stdout);
scanf("%d", &t);
while (t--) {
scanf("%d", &n);
int cnt1 = 0, cnt2 = 0;
for (int i = 1, x; i <= n; ++i) {
scanf("%d", &x);
if (x == 1) ++cnt1;
else if (x == 2) ++cnt2;
}
if (n == 2 && cnt1 + cnt2 == n) puts("A");
else if (cnt1 + cnt2 != n || (cnt2 == 0 && cnt1 % 2 == 0) || (cnt1 == 0 && cnt2 != 0) || (cnt1 > 0 && cnt2 > 0)) puts("B");
else puts("A");
}
return 0;
}