結果
問題 | No.582 キャンディー・ボックス3 |
ユーザー |
![]() |
提出日時 | 2017-10-27 22:27:35 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 771 bytes |
コンパイル時間 | 580 ms |
コンパイル使用メモリ | 73,656 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 10:48:38 |
合計ジャッジ時間 | 1,292 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <iostream> #include <vector> #include <string> #include <cmath> #include <algorithm> #include <utility> #include <queue> #include <set> #include <map> using namespace std; typedef long long ll; typedef pair<int,int> PII; typedef vector<int> VI; typedef vector<VI> VVI; #define MP make_pair #define PB push_back #define inf 1000000007 long long mod = 1000000007; int main(){ int n; cin >> n; vector<ll> c(n); for(int i=0;i<n;i++){ cin >> c[i]; } bool flag = 0; int x=0; int y=0; int z=0; for(int i=0;i<n;i++){ if(c[i]==1){ x++; } if(c[i]==2){ y++; } if(c[i]==0){ z++; } } if(y>=2||(x+y+z!=n)){ cout << "B" << endl; }else{ if((x+2)%2==1){ cout << "A" << endl; }else{ cout << "B" << endl; } } return 0; }