結果

問題 No.2 素因数ゲーム
ユーザー tnodino
提出日時 2021-03-23 23:23:23
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 301 bytes
コンパイル時間 280 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-26 06:23:33
合計ジャッジ時間 2,290 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
from collections import defaultdict
n = int(input())
d = defaultdict(int)
for i in range(2,int(sqrt(n))+1):
    while n % i == 0:
        d[i] += 1
        n //= i
if n > 1:
    d[n] += 1
nim = 0
for i in d.values():
    nim ^= i
if nim:
    print('Alice')
else:
    print('Bob')
0