結果

問題 No.582 キャンディー・ボックス3
ユーザー face4face4
提出日時 2018-08-09 09:04:58
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 477 bytes
コンパイル時間 1,022 ms
コンパイル使用メモリ 64,880 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-24 11:58:27
合計ジャッジ時間 1,947 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,348 KB
testcase_04 AC 1 ms
4,348 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 WA -
testcase_07 AC 2 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,348 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 AC 2 ms
4,348 KB
testcase_16 WA -
testcase_17 AC 1 ms
4,348 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    int n;
    cin >> n;

    int c[n];
    for(int i = 0; i < n; i++)  cin >> c[i];

    int two = 0, one = 0;
    bool judge = true;

    for(int i = 0; i < n; i++){
        if(c[i] > 2)    judge = false;
        else if(c[i] == 1)  one++;
        else if(c[i] == 2)  two++;
    }

    if(!judge || two > 1 || (two + one)%2 == 1){
        cout << "B" << endl;
    }else{
        cout << "A" << endl;
    }

    return 0;
}
0