結果

問題 No.2 素因数ゲーム
ユーザー kutaragi36kutaragi36
提出日時 2023-06-05 06:16:08
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 86,892 KB
実行使用メモリ 75,700 KB
最終ジャッジ日時 2023-08-28 09:24:49
合計ジャッジ時間 4,272 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,276 KB
testcase_01 AC 71 ms
71,380 KB
testcase_02 AC 72 ms
71,276 KB
testcase_03 AC 73 ms
71,140 KB
testcase_04 AC 72 ms
71,204 KB
testcase_05 AC 70 ms
71,384 KB
testcase_06 AC 71 ms
71,136 KB
testcase_07 AC 72 ms
71,164 KB
testcase_08 AC 75 ms
75,396 KB
testcase_09 AC 73 ms
71,368 KB
testcase_10 AC 71 ms
71,372 KB
testcase_11 AC 71 ms
71,356 KB
testcase_12 AC 73 ms
71,180 KB
testcase_13 AC 72 ms
71,380 KB
testcase_14 AC 73 ms
71,188 KB
testcase_15 AC 74 ms
75,356 KB
testcase_16 AC 74 ms
75,700 KB
testcase_17 AC 73 ms
71,500 KB
testcase_18 AC 73 ms
70,972 KB
testcase_19 AC 76 ms
75,440 KB
testcase_20 AC 74 ms
75,348 KB
testcase_21 AC 74 ms
75,368 KB
testcase_22 AC 75 ms
75,324 KB
testcase_23 AC 72 ms
71,144 KB
testcase_24 AC 74 ms
75,404 KB
testcase_25 AC 74 ms
75,400 KB
testcase_26 AC 72 ms
71,208 KB
testcase_27 AC 71 ms
71,360 KB
testcase_28 AC 71 ms
71,180 KB
testcase_29 AC 71 ms
71,148 KB
testcase_30 AC 75 ms
75,408 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())
G = 0
for _, e in factorize(N):
    G ^= e

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