結果

問題 No.2 素因数ゲーム
ユーザー noriocnorioc
提出日時 2024-04-15 05:09:00
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,696 ms / 5,000 ms
コード長 530 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 76,928 KB
最終ジャッジ日時 2024-04-15 05:09:06
合計ジャッジ時間 5,693 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
52,804 KB
testcase_01 AC 40 ms
53,100 KB
testcase_02 AC 40 ms
53,732 KB
testcase_03 AC 46 ms
58,864 KB
testcase_04 AC 41 ms
53,176 KB
testcase_05 AC 45 ms
58,044 KB
testcase_06 AC 40 ms
53,412 KB
testcase_07 AC 60 ms
69,340 KB
testcase_08 AC 45 ms
57,600 KB
testcase_09 AC 1,696 ms
76,928 KB
testcase_10 AC 48 ms
59,032 KB
testcase_11 AC 57 ms
64,492 KB
testcase_12 AC 97 ms
75,512 KB
testcase_13 AC 1,347 ms
76,268 KB
testcase_14 AC 40 ms
53,440 KB
testcase_15 AC 44 ms
58,100 KB
testcase_16 AC 44 ms
57,712 KB
testcase_17 AC 41 ms
53,692 KB
testcase_18 AC 41 ms
53,672 KB
testcase_19 AC 44 ms
59,644 KB
testcase_20 AC 44 ms
58,612 KB
testcase_21 AC 45 ms
58,852 KB
testcase_22 AC 45 ms
58,844 KB
testcase_23 AC 41 ms
53,416 KB
testcase_24 AC 44 ms
58,488 KB
testcase_25 AC 45 ms
58,768 KB
testcase_26 AC 41 ms
52,336 KB
testcase_27 AC 50 ms
62,176 KB
testcase_28 AC 46 ms
58,200 KB
testcase_29 AC 43 ms
52,824 KB
testcase_30 AC 46 ms
58,924 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

try:
    import pypyjit
    pypyjit.set_param('max_unroll_recursion=-1')
except ModuleNotFoundError:
    pass


def factorize(n):
    p = 2
    while p * p <= n:
        while n % p == 0:
            yield p
            n //= p
        p += 1
    if n > 1:
        yield n


N = int(input())
ps = set(factorize(N))


def f(n: int) -> bool:
    res = False
    for p in ps:
        x = n
        while x % p == 0:
            x //= p
            res |= not f(x)

    return res


if f(N):
    print('Alice')
else:
    print('Bob')
0