結果

問題 No.2 素因数ゲーム
コンテスト
ユーザー yoza
提出日時 2014-11-12 01:13:29
言語 Python3
(3.14.2 + numpy 2.4.0 + scipy 1.16.3)
結果
AC  
実行時間 145 ms / 5,000 ms
コード長 363 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 459 ms
コンパイル使用メモリ 20,936 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-01-04 17:26:15
合計ジャッジ時間 6,326 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from functools import reduce

n = int(input())

i = 2
count_list = []
while i * i <= n:
    count = 0
    while n % i == 0:
        count += 1
        n //= i
    if count > 0:
        count_list.append(count)
    i += 1
if n > 1:
    count_list.append(1)

if reduce(lambda x, y: x ^ y, count_list):
    print('Alice')
else:
    print('Bob')
0