結果

問題 No.2 素因数ゲーム
コンテスト
ユーザー もちふわゆるゆる
提出日時 2023-04-14 17:23:47
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 28 ms / 5,000 ms
+ 263µs
コード長 504 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 80 ms
コンパイル使用メモリ 80,896 KB
実行使用メモリ 60,160 KB
最終ジャッジ日時 2026-09-13 03:12:07
合計ジャッジ時間 2,804 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys, math
input = lambda: sys.stdin.readline()[:-1]
def MI(): return map(int, input().split())
inf = 10**18

n, = MI()

# 素因数分解√n
def prime_fac(n):
    res = []
    x = n
    y = 2
    while y*y <= x:
        ex = 0
        while x % y == 0:
            ex += 1
            x //= y
        if ex > 0: res.append((y, ex))
        y += 1
    if x > 1: res.append((x, 1))
    return res

n_prime = prime_fac(n)
ans = 0
for i, c in n_prime:
    ans ^= c
print('Alice' if ans!=0 else 'Bob')
0