結果

問題 No.1506 Unbalanced Pocky Game
ユーザー GRMNGRMN
提出日時 2021-06-20 21:16:49
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,321 bytes
コンパイル時間 4,634 ms
コンパイル使用メモリ 267,484 KB
実行使用メモリ 8,896 KB
最終ジャッジ日時 2023-09-05 01:35:52
合計ジャッジ時間 8,388 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 10 ms
4,376 KB
testcase_15 AC 8 ms
4,380 KB
testcase_16 AC 21 ms
4,380 KB
testcase_17 AC 11 ms
4,376 KB
testcase_18 AC 8 ms
4,380 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 9 ms
4,376 KB
testcase_22 AC 15 ms
4,380 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 29 ms
4,376 KB
testcase_26 AC 94 ms
8,344 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 AC 92 ms
8,488 KB
testcase_30 WA -
testcase_31 AC 96 ms
8,748 KB
testcase_32 WA -
testcase_33 WA -
testcase_34 AC 91 ms
8,308 KB
testcase_35 AC 92 ms
8,344 KB
testcase_36 AC 2 ms
4,380 KB
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 2 ms
4,384 KB
testcase_41 AC 2 ms
4,376 KB
testcase_42 WA -
testcase_43 WA -
testcase_44 AC 1 ms
4,380 KB
testcase_45 WA -
testcase_46 AC 30 ms
4,984 KB
testcase_47 AC 11 ms
4,376 KB
testcase_48 WA -
testcase_49 AC 37 ms
5,280 KB
testcase_50 WA -
testcase_51 WA -
testcase_52 AC 27 ms
4,844 KB
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 AC 11 ms
4,380 KB
testcase_57 AC 31 ms
5,128 KB
testcase_58 WA -
testcase_59 AC 6 ms
4,380 KB
testcase_60 AC 18 ms
4,460 KB
testcase_61 AC 29 ms
5,060 KB
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 35 ms
5,256 KB
testcase_65 AC 20 ms
4,504 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define all(v) begin(v),end(v)
#define rall(v) rbegin(v),rend(v)
#define fi first
#define se second
#define re0 return 0
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using tup = tuple<ll, ll, ll>;
using cp = complex<double>;
constexpr ll inf = 2e9;
constexpr ll llinf = 9e18;
//constexpr ll MOD = 998244353;
constexpr ll MOD = 1000000007;
const double pai = acos(-1);

int main() {
    //cout<<fixed<<setprecision(15);
    int n;cin>>n;
    vector<int> a(n);
    map<int,int> mp;
    rep(i,n){
        cin>>a[i];
        mp[a[i]]++;
    }
    if(mp[1]==0){
        cout<<"Alice"<<endl;
        re0;
    }
    if(mp[1]==n){
        if(n%2)cout<<"Alice"<<endl;
        else cout<<"Bob"<<endl;
    }
    reverse(all(a));
    int cr=0;
    rep(i,n-1)if(a[i]==1&&a[i+1]==1)cr^=1;
    rep(i,n){
        if(a[i]!=1)break;
        cr^=1;
    }
    if(!cr)cout<<"Alice"<<endl;
    else cout<<"Bob"<<endl;
}
0