結果

問題 No.1506 Unbalanced Pocky Game
ユーザー auauaauaua
提出日時 2021-05-14 22:20:18
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 76 ms / 2,000 ms
コード長 1,088 bytes
コンパイル時間 1,804 ms
コンパイル使用メモリ 167,300 KB
実行使用メモリ 15,748 KB
最終ジャッジ日時 2024-04-10 00:45:46
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,944 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 4 ms
6,944 KB
testcase_04 AC 30 ms
10,880 KB
testcase_05 AC 35 ms
11,904 KB
testcase_06 AC 21 ms
8,576 KB
testcase_07 AC 16 ms
7,040 KB
testcase_08 AC 23 ms
8,704 KB
testcase_09 AC 35 ms
12,320 KB
testcase_10 AC 36 ms
12,508 KB
testcase_11 AC 16 ms
7,168 KB
testcase_12 AC 14 ms
6,940 KB
testcase_13 AC 9 ms
6,940 KB
testcase_14 AC 16 ms
7,040 KB
testcase_15 AC 13 ms
6,944 KB
testcase_16 AC 36 ms
12,288 KB
testcase_17 AC 18 ms
7,424 KB
testcase_18 AC 12 ms
6,944 KB
testcase_19 AC 10 ms
6,944 KB
testcase_20 AC 36 ms
12,576 KB
testcase_21 AC 14 ms
6,940 KB
testcase_22 AC 24 ms
9,216 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 AC 48 ms
15,656 KB
testcase_26 AC 73 ms
15,628 KB
testcase_27 AC 73 ms
15,672 KB
testcase_28 AC 71 ms
15,192 KB
testcase_29 AC 73 ms
15,336 KB
testcase_30 AC 75 ms
15,668 KB
testcase_31 AC 76 ms
15,748 KB
testcase_32 AC 74 ms
15,524 KB
testcase_33 AC 73 ms
15,444 KB
testcase_34 AC 71 ms
15,160 KB
testcase_35 AC 72 ms
15,216 KB
testcase_36 AC 2 ms
6,944 KB
testcase_37 AC 2 ms
6,940 KB
testcase_38 AC 2 ms
6,940 KB
testcase_39 AC 2 ms
6,940 KB
testcase_40 AC 2 ms
6,940 KB
testcase_41 AC 2 ms
6,944 KB
testcase_42 AC 2 ms
6,944 KB
testcase_43 AC 2 ms
6,944 KB
testcase_44 AC 2 ms
6,944 KB
testcase_45 AC 2 ms
6,940 KB
testcase_46 AC 27 ms
7,552 KB
testcase_47 AC 10 ms
6,940 KB
testcase_48 AC 13 ms
6,944 KB
testcase_49 AC 33 ms
8,320 KB
testcase_50 AC 28 ms
7,552 KB
testcase_51 AC 31 ms
8,064 KB
testcase_52 AC 24 ms
7,040 KB
testcase_53 AC 36 ms
8,960 KB
testcase_54 AC 15 ms
6,944 KB
testcase_55 AC 11 ms
6,944 KB
testcase_56 AC 10 ms
6,940 KB
testcase_57 AC 28 ms
7,552 KB
testcase_58 AC 10 ms
6,940 KB
testcase_59 AC 7 ms
6,940 KB
testcase_60 AC 17 ms
6,944 KB
testcase_61 AC 26 ms
7,296 KB
testcase_62 AC 21 ms
6,944 KB
testcase_63 AC 16 ms
6,944 KB
testcase_64 AC 31 ms
8,064 KB
testcase_65 AC 18 ms
6,940 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