結果

問題 No.103 素因数ゲーム リターンズ
ユーザー buey_tbuey_t
提出日時 2023-04-27 13:34:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 153 ms / 5,000 ms
コード長 1,587 bytes
コンパイル時間 220 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 89,476 KB
最終ジャッジ日時 2024-04-28 07:12:11
合計ジャッジ時間 4,707 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 139 ms
84,992 KB
testcase_01 AC 125 ms
85,096 KB
testcase_02 AC 132 ms
84,864 KB
testcase_03 AC 132 ms
84,992 KB
testcase_04 AC 128 ms
84,864 KB
testcase_05 AC 128 ms
85,120 KB
testcase_06 AC 128 ms
84,864 KB
testcase_07 AC 127 ms
85,120 KB
testcase_08 AC 133 ms
84,992 KB
testcase_09 AC 130 ms
85,224 KB
testcase_10 AC 134 ms
85,120 KB
testcase_11 AC 129 ms
85,120 KB
testcase_12 AC 143 ms
89,344 KB
testcase_13 AC 146 ms
89,060 KB
testcase_14 AC 141 ms
89,400 KB
testcase_15 AC 148 ms
89,212 KB
testcase_16 AC 136 ms
85,104 KB
testcase_17 AC 147 ms
89,428 KB
testcase_18 AC 145 ms
89,144 KB
testcase_19 AC 145 ms
89,304 KB
testcase_20 AC 153 ms
89,348 KB
testcase_21 AC 148 ms
89,288 KB
testcase_22 AC 150 ms
89,304 KB
testcase_23 AC 141 ms
89,476 KB
testcase_24 AC 141 ms
89,344 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