結果
問題 |
No.2813 Cookie
|
ユーザー |
|
提出日時 | 2024-07-19 22:34:41 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 759 bytes |
コンパイル時間 | 716 ms |
コンパイル使用メモリ | 74,000 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-19 22:34:48 |
合計ジャッジ時間 | 3,128 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 1 |
other | AC * 2 WA * 28 |
ソースコード
#include <iostream> #include <vector> using namespace std; bool canAliceWin(const vector<int>& A) { int moves = 0; for (int a : A) { // Each size greater than 1 adds potential moves if (a > 1) { moves += (a - 1); } } // If total moves are odd, Alice wins, otherwise Bob wins return moves % 2 == 1; } int main() { int T; cin >> T; vector<string> results; for (int t = 0; t < T; ++t) { int N; cin >> N; vector<int> A(N); for (int i = 0; i < N; ++i) { cin >> A[i]; } results.push_back(canAliceWin(A) ? "Alice" : "Bob"); } for (const string& result : results) { cout << result << endl; } return 0; }