結果
| 問題 |
No.1506 Unbalanced Pocky Game
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-05-14 23:42:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 503 bytes |
| コンパイル時間 | 1,484 ms |
| コンパイル使用メモリ | 167,484 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-02 05:51:28 |
| 合計ジャッジ時間 | 4,497 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 46 WA * 17 |
ソースコード
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using pii = pair<int, int>;
int main() {
int n;
cin >> n;
int turn = 1; //0:alice 1:bob
rep(i, n) {
int a;
cin >> a;
if (i == 0) turn = !turn;
else if (i < n - 1) {
if (a == 1) turn = !turn;
}
else {
if (a == 1) turn = !turn;
else turn = 0;
}
}
if (turn == 0) cout << "Alice" << endl;
else cout << "Bob" << endl;
return 0;
}