結果

問題 No.103 素因数ゲーム リターンズ
ユーザー buey_tbuey_t
提出日時 2023-04-27 13:34:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 235 ms / 5,000 ms
コード長 1,587 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 87,048 KB
実行使用メモリ 83,088 KB
最終ジャッジ日時 2023-08-10 14:04:25
合計ジャッジ時間 7,561 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 225 ms
82,408 KB
testcase_01 AC 224 ms
82,652 KB
testcase_02 AC 235 ms
82,612 KB
testcase_03 AC 224 ms
82,520 KB
testcase_04 AC 221 ms
82,772 KB
testcase_05 AC 217 ms
82,740 KB
testcase_06 AC 219 ms
82,572 KB
testcase_07 AC 214 ms
82,396 KB
testcase_08 AC 209 ms
82,780 KB
testcase_09 AC 215 ms
82,616 KB
testcase_10 AC 207 ms
82,524 KB
testcase_11 AC 205 ms
82,780 KB
testcase_12 AC 228 ms
82,996 KB
testcase_13 AC 217 ms
82,948 KB
testcase_14 AC 217 ms
82,696 KB
testcase_15 AC 214 ms
82,684 KB
testcase_16 AC 222 ms
82,540 KB
testcase_17 AC 223 ms
82,816 KB
testcase_18 AC 218 ms
82,808 KB
testcase_19 AC 214 ms
82,960 KB
testcase_20 AC 212 ms
82,968 KB
testcase_21 AC 224 ms
82,856 KB
testcase_22 AC 209 ms
83,088 KB
testcase_23 AC 210 ms
82,792 KB
testcase_24 AC 217 ms
82,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt,sin,cos,tan,ceil,radians,floor,gcd,exp,log,log10,log2,factorial,fsum
from heapq import heapify, heappop, heappush
from bisect import bisect_left, bisect_right
from copy import deepcopy
import copy
import random
from random import randrange
from collections import deque,Counter,defaultdict
from itertools import permutations,combinations
from decimal import Decimal,ROUND_HALF_UP
#tmp = Decimal(mid).quantize(Decimal('0'), rounding=ROUND_HALF_UP)
from functools import lru_cache, reduce
#@lru_cache(maxsize=None)
from operator import add,sub,mul,xor,and_,or_,itemgetter
import sys
input = sys.stdin.readline
# .rstrip()
INF = 10**18
mod1 = 10**9+7
mod2 = 998244353

#DecimalならPython
#再帰ならPython!!!!!!!!!!!!!!!!!!!!!!!!!!

#[素因数, 何乗か]
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr


'''
回数制限あり
グランディ数

012 012 012..
'''

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

A = []

for i in range(N):
    prime = factorization(M[i])
    for p,e in prime:
        if e%3 == 0:
            A.append(0)
        elif e%3 == 1:
            A.append(1)
        else:
            A.append(2)

x = A[0]
for i in range(1,len(A)):
    x ^= A[i]

if x == 0:
    print('Bob')
else:
    print('Alice')






















0