結果

問題 No.2 素因数ゲーム
ユーザー vwxyz
提出日時 2022-08-10 02:39:15
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 30 ms / 5,000 ms
コード長 444 bytes
コンパイル時間 177 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-09-20 07:27:44
合計ジャッジ時間 1,795 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import sys
readline=sys.stdin.readline

def Factorize(N):
    assert N>=1
    factors=defaultdict(int)
    for p in range(2,N):
        if p**2>N:
            break
        while N%p==0:
            factors[p]+=1
            N//=p
    if N!=1:
        factors[N]+=1
    return factors

N=int(readline())
xor=0
for p,e in Factorize(N).items():
    xor^=e
if xor:
    ans="Alice"
else:
    ans="Bob"
print(ans)
0