結果
問題 | No.582 キャンディー・ボックス3 |
ユーザー |
![]() |
提出日時 | 2017-10-27 22:36:24 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 2,060 ms |
コンパイル使用メモリ | 192,872 KB |
最終ジャッジ日時 | 2025-01-05 03:35:46 |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include<bits/stdc++.h> using namespace std; using int64 = long long; int main() { int N; cin >> N; int latte = 0, malta = 0, beet = 0; for(int i = 0; i < N; i++) { int x; cin >> x; if(x == 1) ++latte; else if(x == 2) ++malta; else if(x >= 3) ++beet; } if(latte % 2 == 1 && malta == 0 && beet == 0) { cout << "A" << endl; return (0); } if(latte % 2 == 1 && malta == 1 && beet == 0) { cout << "A" << endl; return (0); } cout << "B" << endl; }