結果

問題 No.1506 Unbalanced Pocky Game
ユーザー 👑 H20H20
提出日時 2021-05-15 01:44:13
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 151 ms / 2,000 ms
コード長 420 bytes
コンパイル時間 605 ms
コンパイル使用メモリ 86,956 KB
実行使用メモリ 107,316 KB
最終ジャッジ日時 2023-07-25 14:31:14
合計ジャッジ時間 11,487 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,788 KB
testcase_01 AC 97 ms
71,848 KB
testcase_02 AC 94 ms
71,824 KB
testcase_03 AC 104 ms
77,492 KB
testcase_04 AC 129 ms
93,760 KB
testcase_05 AC 129 ms
95,792 KB
testcase_06 AC 118 ms
88,156 KB
testcase_07 AC 114 ms
84,332 KB
testcase_08 AC 119 ms
88,268 KB
testcase_09 AC 132 ms
96,024 KB
testcase_10 AC 134 ms
98,632 KB
testcase_11 AC 113 ms
84,356 KB
testcase_12 AC 113 ms
83,480 KB
testcase_13 AC 105 ms
78,868 KB
testcase_14 AC 113 ms
84,308 KB
testcase_15 AC 110 ms
82,068 KB
testcase_16 AC 125 ms
95,172 KB
testcase_17 AC 110 ms
84,788 KB
testcase_18 AC 110 ms
80,952 KB
testcase_19 AC 106 ms
80,012 KB
testcase_20 AC 127 ms
98,200 KB
testcase_21 AC 108 ms
82,648 KB
testcase_22 AC 118 ms
89,712 KB
testcase_23 AC 94 ms
71,840 KB
testcase_24 AC 96 ms
71,848 KB
testcase_25 AC 151 ms
105,552 KB
testcase_26 AC 145 ms
107,128 KB
testcase_27 AC 146 ms
107,316 KB
testcase_28 AC 148 ms
107,196 KB
testcase_29 AC 145 ms
107,052 KB
testcase_30 AC 148 ms
107,288 KB
testcase_31 AC 147 ms
107,268 KB
testcase_32 AC 143 ms
107,220 KB
testcase_33 AC 145 ms
107,104 KB
testcase_34 AC 142 ms
107,180 KB
testcase_35 AC 148 ms
107,076 KB
testcase_36 AC 97 ms
71,736 KB
testcase_37 AC 99 ms
71,604 KB
testcase_38 AC 98 ms
71,676 KB
testcase_39 AC 97 ms
71,868 KB
testcase_40 AC 95 ms
71,708 KB
testcase_41 AC 94 ms
71,324 KB
testcase_42 AC 102 ms
71,844 KB
testcase_43 AC 96 ms
71,556 KB
testcase_44 AC 95 ms
71,316 KB
testcase_45 AC 94 ms
71,828 KB
testcase_46 AC 116 ms
85,784 KB
testcase_47 AC 107 ms
78,380 KB
testcase_48 AC 109 ms
79,000 KB
testcase_49 AC 118 ms
87,496 KB
testcase_50 AC 114 ms
85,808 KB
testcase_51 AC 118 ms
87,216 KB
testcase_52 AC 114 ms
84,468 KB
testcase_53 AC 122 ms
90,380 KB
testcase_54 AC 108 ms
79,612 KB
testcase_55 AC 103 ms
78,316 KB
testcase_56 AC 104 ms
78,304 KB
testcase_57 AC 110 ms
85,756 KB
testcase_58 AC 103 ms
77,728 KB
testcase_59 AC 101 ms
76,988 KB
testcase_60 AC 108 ms
80,940 KB
testcase_61 AC 115 ms
85,908 KB
testcase_62 AC 114 ms
83,312 KB
testcase_63 AC 108 ms
80,332 KB
testcase_64 AC 117 ms
87,300 KB
testcase_65 AC 109 ms
80,972 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