結果

問題 No.582 キャンディー・ボックス3
ユーザー squid
提出日時 2017-10-27 22:48:16
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 657 bytes
コンパイル時間 365 ms
コンパイル使用メモリ 55,856 KB
実行使用メモリ 6,816 KB
最終ジャッジ日時 2024-11-21 22:08:04
合計ジャッジ時間 1,035 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    long long int n,maxi=-1;
    long long int c[151];
    bool flag;
    int cnt1=0,cnt0=0;
    cin>>n;
    for(int i=0; i<n; i++){
        cin>>c[i];
        maxi=max(maxi,c[i]);
        if(c[i]==1){
            cnt1++;
        }
        if(c[i]==0){
            cnt0++;
        }
    }
    if(n==cnt1+cnt0){
        if(cnt1%2==1){
            flag=true;
        }
        else{
            flag=false;
        }
    }
    else{
        if(maxi==2&&cnt1+1==n-cnt0){
            flag=true;
        }
        else{
            flag=false;
        }
    }
    cout<<((flag)?'A':'B')<<endl;
    return 0;
}
0