結果
| 問題 | No.103 素因数ゲーム リターンズ | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-05-21 11:09:40 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 67 ms / 5,000 ms | 
| コード長 | 604 bytes | 
| コンパイル時間 | 295 ms | 
| コンパイル使用メモリ | 82,044 KB | 
| 実行使用メモリ | 63,104 KB | 
| 最終ジャッジ日時 | 2024-12-21 18:55:10 | 
| 合計ジャッジ時間 | 2,730 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 5 | 
| other | AC * 20 | 
ソースコード
gru = [0]*(11)
for i in range(1,11):
    me = []
    for j in range(1,3):
        if i-j >= 0:
            me.append(gru[i-j])
    ans = 0
    while ans in me:
        ans+=1
    gru[i] = ans
n = int(input())
m = list(map(int,input().split()))
from collections import defaultdict
we = 0
for i in m:
    nd = defaultdict(int)
    con = 2
    while con**2 <= i:
        if i%con == 0:
            nd[con] +=1
            i /= con
        else:
            con+=1
    if i != 1:
        nd[i]+=1
    ans = 0
    for j in nd:
        ans = ans^gru[nd[j]]
    we = we^ans
print("Alice" if we != 0 else "Bob")
            
            
            
        