結果

問題 No.2 素因数ゲーム
ユーザー rarpipipirarpipipi
提出日時 2023-04-09 18:06:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 44 ms / 5,000 ms
コード長 465 bytes
コンパイル時間 288 ms
コンパイル使用メモリ 82,204 KB
実行使用メモリ 60,228 KB
最終ジャッジ日時 2024-04-15 07:00:47
合計ジャッジ時間 2,763 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,960 KB
testcase_01 AC 40 ms
53,772 KB
testcase_02 AC 40 ms
54,464 KB
testcase_03 AC 40 ms
55,056 KB
testcase_04 AC 41 ms
54,688 KB
testcase_05 AC 40 ms
54,808 KB
testcase_06 AC 40 ms
53,928 KB
testcase_07 AC 41 ms
54,108 KB
testcase_08 AC 41 ms
54,332 KB
testcase_09 AC 40 ms
54,044 KB
testcase_10 AC 39 ms
53,352 KB
testcase_11 AC 41 ms
53,940 KB
testcase_12 AC 40 ms
53,836 KB
testcase_13 AC 40 ms
54,124 KB
testcase_14 AC 41 ms
54,652 KB
testcase_15 AC 44 ms
60,228 KB
testcase_16 AC 42 ms
54,440 KB
testcase_17 AC 40 ms
54,012 KB
testcase_18 AC 39 ms
55,064 KB
testcase_19 AC 43 ms
59,212 KB
testcase_20 AC 43 ms
60,108 KB
testcase_21 AC 44 ms
59,432 KB
testcase_22 AC 41 ms
54,712 KB
testcase_23 AC 41 ms
55,332 KB
testcase_24 AC 42 ms
53,700 KB
testcase_25 AC 41 ms
54,216 KB
testcase_26 AC 40 ms
54,016 KB
testcase_27 AC 40 ms
54,504 KB
testcase_28 AC 41 ms
54,476 KB
testcase_29 AC 40 ms
53,728 KB
testcase_30 AC 44 ms
59,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# 素因数分解のリストを返す
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
   
from collections import Counter
c=Counter(prime_factorize(int(input())))
work=0
for v in c.values():
    work^=v
print("Alice" if work!=0 else "Bob")
0