結果
| 問題 |
No.582 キャンディー・ボックス3
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-08-05 07:01:06 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 446 bytes |
| コンパイル時間 | 2,888 ms |
| コンパイル使用メモリ | 191,312 KB |
| 最終ジャッジ日時 | 2025-01-12 14:41:25 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(int)(n); i++)
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
int x = 0;
int hist = 0;
int sum = 0;
REP (i, n) {
int c;
cin >> c;
x = max(x, c);
if (c == 2) hist++;
sum += c;
sum %= 2;
}
if (sum && x <= 2 && hist <= 1)
cout << "A" << endl;
else
cout << "B" << endl;
return 0;
}