結果

問題 No.1506 Unbalanced Pocky Game
ユーザー icchipost
提出日時 2021-05-14 23:53:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 437 bytes
コンパイル時間 1,514 ms
コンパイル使用メモリ 169,112 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-02 06:22:03
合計ジャッジ時間 4,521 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 46 WA * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int turn = 0; //0:alice 1:bob
  rep(i, n - 1) {
    if (i == 0 || a[i] == 1) turn = !turn;
  }
  if (a[n - 1] > 1) turn = 0; 
  if (turn == 0) cout << "Alice" << endl;
  else cout << "Bob" << endl;
  return 0;
}
0