結果

問題 No.1506 Unbalanced Pocky Game
ユーザー 👑 H20H20
提出日時 2021-05-15 01:44:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 91 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 184 ms
コンパイル使用メモリ 82,104 KB
実行使用メモリ 107,884 KB
最終ジャッジ日時 2024-04-10 06:43:38
合計ジャッジ時間 5,887 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,692 KB
testcase_01 AC 39 ms
54,680 KB
testcase_02 AC 40 ms
53,684 KB
testcase_03 AC 48 ms
64,256 KB
testcase_04 AC 69 ms
91,160 KB
testcase_05 AC 78 ms
96,964 KB
testcase_06 AC 63 ms
82,788 KB
testcase_07 AC 58 ms
76,864 KB
testcase_08 AC 63 ms
84,484 KB
testcase_09 AC 80 ms
97,684 KB
testcase_10 AC 82 ms
100,172 KB
testcase_11 AC 56 ms
76,948 KB
testcase_12 AC 55 ms
76,244 KB
testcase_13 AC 47 ms
67,416 KB
testcase_14 AC 55 ms
75,032 KB
testcase_15 AC 51 ms
71,060 KB
testcase_16 AC 66 ms
91,472 KB
testcase_17 AC 53 ms
76,808 KB
testcase_18 AC 50 ms
70,292 KB
testcase_19 AC 48 ms
68,120 KB
testcase_20 AC 68 ms
94,460 KB
testcase_21 AC 51 ms
74,400 KB
testcase_22 AC 59 ms
82,696 KB
testcase_23 AC 39 ms
54,484 KB
testcase_24 AC 40 ms
54,584 KB
testcase_25 AC 91 ms
107,884 KB
testcase_26 AC 89 ms
106,920 KB
testcase_27 AC 89 ms
106,576 KB
testcase_28 AC 87 ms
107,004 KB
testcase_29 AC 88 ms
106,864 KB
testcase_30 AC 87 ms
106,736 KB
testcase_31 AC 89 ms
106,648 KB
testcase_32 AC 88 ms
106,892 KB
testcase_33 AC 90 ms
106,840 KB
testcase_34 AC 87 ms
107,160 KB
testcase_35 AC 88 ms
106,876 KB
testcase_36 AC 38 ms
55,068 KB
testcase_37 AC 39 ms
55,336 KB
testcase_38 AC 39 ms
53,948 KB
testcase_39 AC 41 ms
54,304 KB
testcase_40 AC 40 ms
54,520 KB
testcase_41 AC 40 ms
54,916 KB
testcase_42 AC 40 ms
54,308 KB
testcase_43 AC 40 ms
54,748 KB
testcase_44 AC 40 ms
54,224 KB
testcase_45 AC 39 ms
54,300 KB
testcase_46 AC 57 ms
78,452 KB
testcase_47 AC 48 ms
66,180 KB
testcase_48 AC 49 ms
68,088 KB
testcase_49 AC 59 ms
79,880 KB
testcase_50 AC 57 ms
77,828 KB
testcase_51 AC 58 ms
79,412 KB
testcase_52 AC 55 ms
74,992 KB
testcase_53 AC 63 ms
84,200 KB
testcase_54 AC 48 ms
70,316 KB
testcase_55 AC 48 ms
67,904 KB
testcase_56 AC 48 ms
65,976 KB
testcase_57 AC 58 ms
77,912 KB
testcase_58 AC 49 ms
65,816 KB
testcase_59 AC 45 ms
63,672 KB
testcase_60 AC 51 ms
70,620 KB
testcase_61 AC 57 ms
77,748 KB
testcase_62 AC 53 ms
74,552 KB
testcase_63 AC 51 ms
70,148 KB
testcase_64 AC 59 ms
79,464 KB
testcase_65 AC 51 ms
70,640 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import collections
N = int(input())
A = list(map(int, input().split()))
D = collections.deque(A)
aliceWin = False
while len(D) and D[0]==1:
    D.popleft()
    aliceWin = not aliceWin
if len(D)==0:
    if aliceWin:
        print('Alice')
    else:
        print('Bob')
    exit()

aliceWin = True 
while len(D) and D[-1]==1:
    D.pop()
    aliceWin = not aliceWin
if aliceWin:
    print('Alice')
else:
    print('Bob')
0