結果

問題 No.2 素因数ゲーム
ユーザー (ΦωΦ)
提出日時 2015-04-15 07:19:51
言語 Python2
(2.7.18)
結果
AC  
実行時間 19 ms / 5,000 ms
コード長 374 bytes
コンパイル時間 197 ms
コンパイル使用メモリ 6,784 KB
実行使用メモリ 6,784 KB
最終ジャッジ日時 2024-12-26 11:06:00
合計ジャッジ時間 1,846 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/python
from collections import defaultdict
from operator import xor

def factorize(n):
    res = defaultdict(int)
    d = 2
    while d * d <= n:
        while n % d == 0:
            res[d] += 1
            n /= d
        d += 1
    if n > 1:
        res[n] += 1
    return res

N = int(raw_input())
print 'Alice' if reduce(xor, factorize(N).values()) else 'Bob'
0