結果

問題 No.1506 Unbalanced Pocky Game
ユーザー auauaauaua
提出日時 2021-05-14 22:20:18
言語 C++14
(gcc 11.2.0 + boost 1.78.0)
結果
AC  
実行時間 65 ms / 2,000 ms
コード長 1,088 bytes
コンパイル時間 1,212 ms
使用メモリ 15,580 KB
最終ジャッジ日時 2022-11-25 19:05:03
合計ジャッジ時間 4,972 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
使用メモリ
testcase_00 AC 1 ms
3,444 KB
testcase_01 AC 1 ms
3,524 KB
testcase_02 AC 1 ms
3,440 KB
testcase_03 AC 3 ms
3,872 KB
testcase_04 AC 26 ms
10,436 KB
testcase_05 AC 29 ms
11,828 KB
testcase_06 AC 18 ms
8,328 KB
testcase_07 AC 13 ms
6,824 KB
testcase_08 AC 19 ms
8,592 KB
testcase_09 AC 28 ms
12,068 KB
testcase_10 AC 29 ms
12,356 KB
testcase_11 AC 13 ms
7,060 KB
testcase_12 AC 12 ms
6,584 KB
testcase_13 AC 7 ms
4,936 KB
testcase_14 AC 13 ms
6,876 KB
testcase_15 AC 12 ms
6,268 KB
testcase_16 AC 29 ms
12,060 KB
testcase_17 AC 14 ms
7,352 KB
testcase_18 AC 10 ms
5,688 KB
testcase_19 AC 9 ms
5,160 KB
testcase_20 AC 31 ms
12,332 KB
testcase_21 AC 13 ms
6,472 KB
testcase_22 AC 21 ms
9,240 KB
testcase_23 AC 1 ms
3,428 KB
testcase_24 AC 1 ms
3,372 KB
testcase_25 AC 40 ms
15,500 KB
testcase_26 AC 60 ms
15,252 KB
testcase_27 AC 61 ms
15,424 KB
testcase_28 AC 56 ms
14,964 KB
testcase_29 AC 59 ms
15,172 KB
testcase_30 AC 65 ms
15,580 KB
testcase_31 AC 59 ms
15,380 KB
testcase_32 AC 58 ms
15,316 KB
testcase_33 AC 59 ms
15,244 KB
testcase_34 AC 57 ms
14,908 KB
testcase_35 AC 56 ms
14,856 KB
testcase_36 AC 1 ms
3,388 KB
testcase_37 AC 2 ms
3,412 KB
testcase_38 AC 2 ms
3,488 KB
testcase_39 AC 1 ms
3,528 KB
testcase_40 AC 1 ms
3,380 KB
testcase_41 AC 2 ms
3,468 KB
testcase_42 AC 1 ms
3,440 KB
testcase_43 AC 1 ms
3,568 KB
testcase_44 AC 2 ms
3,484 KB
testcase_45 AC 1 ms
3,448 KB
testcase_46 AC 22 ms
7,304 KB
testcase_47 AC 8 ms
4,444 KB
testcase_48 AC 10 ms
4,888 KB
testcase_49 AC 26 ms
8,100 KB
testcase_50 AC 23 ms
7,264 KB
testcase_51 AC 28 ms
7,848 KB
testcase_52 AC 21 ms
6,792 KB
testcase_53 AC 31 ms
8,848 KB
testcase_54 AC 12 ms
5,292 KB
testcase_55 AC 9 ms
4,628 KB
testcase_56 AC 9 ms
4,360 KB
testcase_57 AC 23 ms
7,336 KB
testcase_58 AC 8 ms
4,492 KB
testcase_59 AC 6 ms
3,928 KB
testcase_60 AC 14 ms
5,728 KB
testcase_61 AC 22 ms
7,324 KB
testcase_62 AC 18 ms
6,476 KB
testcase_63 AC 13 ms
5,528 KB
testcase_64 AC 25 ms
7,796 KB
testcase_65 AC 13 ms
5,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
#define double long double
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
//typedef long double ld;
typedef complex<double> Complex;
const ll INF=1e9+7;
const ll MOD=INF;
const ll inf=INF*INF;
const ll mod=MOD;
const ll MAX=200010;



signed main(){
    ll n;cin>>n;
    vector<ll>a(n);
    rep(i,n)cin>>a[i];
    ll now=0;
    vector<vector<ll> >dp(n,vector<ll>(2));
    dp[0][1]=1;
    REP(i,1,n){
        if(a[i]==1){
            dp[i][0]=dp[i-1][1];
            dp[i][1]=dp[i-1][0];
        }else{
            dp[i][1]=max(dp[i-1][0],dp[i-1][1]);
            dp[i][0]=1-dp[i][1];
        }
    }
    if(dp[n-1][1]){
        cout<<"Alice"<<endl;
    }else{
        cout<<"Bob"<<endl;
    }
}
0