結果

問題 No.2 素因数ゲーム
ユーザー kumatan400kumatan400
提出日時 2023-04-05 10:28:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 36 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 156 ms
コンパイル使用メモリ 82,404 KB
実行使用メモリ 58,924 KB
最終ジャッジ日時 2024-04-09 21:26:24
合計ジャッジ時間 2,182 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
53,220 KB
testcase_01 AC 29 ms
51,944 KB
testcase_02 AC 32 ms
53,792 KB
testcase_03 AC 32 ms
52,476 KB
testcase_04 AC 30 ms
54,156 KB
testcase_05 AC 30 ms
52,960 KB
testcase_06 AC 30 ms
52,864 KB
testcase_07 AC 29 ms
51,956 KB
testcase_08 AC 32 ms
58,652 KB
testcase_09 AC 30 ms
53,108 KB
testcase_10 AC 31 ms
53,708 KB
testcase_11 AC 31 ms
52,284 KB
testcase_12 AC 31 ms
53,880 KB
testcase_13 AC 32 ms
52,836 KB
testcase_14 AC 31 ms
52,268 KB
testcase_15 AC 33 ms
57,256 KB
testcase_16 AC 34 ms
57,596 KB
testcase_17 AC 31 ms
52,488 KB
testcase_18 AC 31 ms
51,824 KB
testcase_19 AC 34 ms
58,300 KB
testcase_20 AC 34 ms
57,984 KB
testcase_21 AC 35 ms
57,796 KB
testcase_22 AC 33 ms
57,668 KB
testcase_23 AC 30 ms
53,376 KB
testcase_24 AC 34 ms
58,924 KB
testcase_25 AC 36 ms
58,488 KB
testcase_26 AC 33 ms
52,412 KB
testcase_27 AC 31 ms
52,816 KB
testcase_28 AC 32 ms
52,756 KB
testcase_29 AC 31 ms
52,800 KB
testcase_30 AC 34 ms
57,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorize(n):
    fct = []  # prime factor
    b, e = 2, 0  # base, exponent
    while b * b <= n:
        while n % b == 0:
            n = n // b
            e = e + 1
        if e > 0:
            fct.append((b, e))
        b, e = b + 1, 0
    if n > 1:
        fct.append((n, 1))
    return fct


N = int(input())
X = 0
for _, e in factorize(N):
    X ^= e

if X == 0:
    print("Bob")
else:
    print("Alice")
0