結果
問題 | No.582 キャンディー・ボックス3 |
ユーザー |
![]() |
提出日時 | 2021-01-18 20:19:08 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 519 bytes |
コンパイル時間 | 1,714 ms |
コンパイル使用メモリ | 166,640 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-14 12:02:11 |
合計ジャッジ時間 | 2,557 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin >> n; int one = 0; int two = 0; for (int i = 0; i<n ; i++){ int c; cin >> c; if (c == 0) continue; else if (c == 1) one += 1; else if (c == 2) two += 1; else { cout << "B" << endl; return 0; } } if (one % 2 == 1 and two == 0) cout << "A" << endl; else if (one % 2 == 1 and two == 1) cout << "A" << endl; else cout << "B" << endl; return 0; }