結果

問題 No.103 素因数ゲーム リターンズ
ユーザー toyuzuko
提出日時 2020-08-27 20:13:59
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 456 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-08 02:24:15
合計ジャッジ時間 1,978 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 2
other AC * 15 WA * 5
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

def factorize(n):
    if n == 1: return []
    res = []
    x, y = n, 2
    while y * y <= x:
        while x % y == 0:
            res.append(y)
            x //= y
        y += 1
    if x > 1:
        res.append(x)
    return res

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

g = 0

for m in M:
    c = Counter(factorize(m))
    for v in c.values():
        g ^= v % 2
        
print('Alice' if g != 0 else 'Bob')
0