結果

問題 No.1506 Unbalanced Pocky Game
ユーザー kuro_Bkuro_B
提出日時 2023-05-16 10:35:13
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,616 bytes
コンパイル時間 222 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 27,552 KB
最終ジャッジ日時 2024-05-08 09:14:00
合計ジャッジ時間 9,933 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
14,080 KB
testcase_01 AC 58 ms
14,080 KB
testcase_02 AC 54 ms
14,208 KB
testcase_03 RE -
testcase_04 RE -
testcase_05 RE -
testcase_06 RE -
testcase_07 RE -
testcase_08 RE -
testcase_09 RE -
testcase_10 RE -
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 AC 52 ms
14,080 KB
testcase_24 AC 52 ms
14,080 KB
testcase_25 RE -
testcase_26 RE -
testcase_27 RE -
testcase_28 RE -
testcase_29 RE -
testcase_30 RE -
testcase_31 RE -
testcase_32 RE -
testcase_33 RE -
testcase_34 RE -
testcase_35 RE -
testcase_36 AC 54 ms
14,336 KB
testcase_37 RE -
testcase_38 AC 54 ms
14,464 KB
testcase_39 AC 53 ms
14,336 KB
testcase_40 AC 54 ms
14,208 KB
testcase_41 AC 54 ms
14,336 KB
testcase_42 AC 54 ms
14,464 KB
testcase_43 RE -
testcase_44 AC 53 ms
14,336 KB
testcase_45 AC 53 ms
14,080 KB
testcase_46 RE -
testcase_47 RE -
testcase_48 RE -
testcase_49 RE -
testcase_50 RE -
testcase_51 RE -
testcase_52 RE -
testcase_53 RE -
testcase_54 RE -
testcase_55 RE -
testcase_56 RE -
testcase_57 RE -
testcase_58 RE -
testcase_59 RE -
testcase_60 RE -
testcase_61 RE -
testcase_62 RE -
testcase_63 RE -
testcase_64 RE -
testcase_65 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

###スニペット始まり###
import sys, re
from copy import copy, deepcopy
from math import ceil, floor, sqrt,factorial, gcd, pi, degrees, radians, sin, asin, cos, acos, tan, atan2
from statistics import mean, median
from collections import Counter, deque, defaultdict
from heapq import heapify, heappop, heappush
from itertools import permutations, accumulate, product, combinations, combinations_with_replacement
from bisect import bisect, bisect_left, bisect_right
from functools import reduce, lru_cache
from string import ascii_uppercase, ascii_lowercase
from decimal import Decimal, ROUND_HALF_UP #四捨五入用

def input(): return sys.stdin.readline().rstrip('\n')
#easy-testのpypyでは再帰数を下げる。
if __file__=='prog.py':
    sys.setrecursionlimit(10**5)
else:
    sys.setrecursionlimit(10**6)

def lcm(a, b): return a * b // gcd(a, b)

#3つ以上の最大公約数/最小公倍数。Nを要素数、Mを数値の大きさとして、O(NlogM)
def gcd_v2(l: list): return reduce(gcd, l)
def lcm_v2(l: list): return reduce(lcm, l)

#nPk
def nPk(n, k): return factorial(n) // factorial(n - k)

#逆元
def modinv(a, mod=10**9+7): return pow(a, mod-2, mod)
INF = float('inf')
MOD = 10 ** 9 + 7
###スニペット終わり###

N=int(input())
A=list(map(int, input().split()))

#先手が勝つか。
@lru_cache(None)
def rec(n,state):
    if n==1:
        return True
    else:
        if state==1:
            return not rec(n-1,min(A[n-2], 2))
        else:
            return (not rec(n,1))|(not rec(n-1,min(A[n-2], 2)))

if rec(N,min(A[N-1], 2)):
    print('Alice')
else:
    print('Bob')
0