結果

問題 No.2 素因数ゲーム
ユーザー ayaoniayaoni
提出日時 2020-11-30 00:18:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 519 bytes
コンパイル時間 343 ms
コンパイル使用メモリ 87,368 KB
実行使用メモリ 76,256 KB
最終ジャッジ日時 2023-10-11 02:41:28
合計ジャッジ時間 4,132 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,692 KB
testcase_01 AC 70 ms
71,956 KB
testcase_02 AC 70 ms
71,628 KB
testcase_03 AC 69 ms
71,808 KB
testcase_04 AC 70 ms
71,928 KB
testcase_05 AC 71 ms
71,692 KB
testcase_06 AC 74 ms
75,676 KB
testcase_07 AC 75 ms
75,672 KB
testcase_08 AC 74 ms
75,536 KB
testcase_09 AC 74 ms
75,832 KB
testcase_10 AC 73 ms
75,848 KB
testcase_11 AC 75 ms
75,896 KB
testcase_12 AC 74 ms
75,900 KB
testcase_13 AC 74 ms
75,872 KB
testcase_14 AC 73 ms
75,672 KB
testcase_15 AC 73 ms
75,684 KB
testcase_16 AC 74 ms
75,852 KB
testcase_17 AC 73 ms
75,856 KB
testcase_18 AC 74 ms
75,736 KB
testcase_19 AC 73 ms
75,868 KB
testcase_20 AC 74 ms
75,672 KB
testcase_21 AC 72 ms
75,676 KB
testcase_22 AC 73 ms
75,980 KB
testcase_23 AC 73 ms
75,888 KB
testcase_24 AC 75 ms
75,784 KB
testcase_25 AC 73 ms
75,876 KB
testcase_26 AC 75 ms
75,788 KB
testcase_27 AC 75 ms
76,256 KB
testcase_28 AC 76 ms
75,672 KB
testcase_29 AC 74 ms
75,792 KB
testcase_30 AC 73 ms
75,672 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
def I(): return int(sys.stdin.readline().rstrip())


def prime_factorization(n):  # nの素因数分解
    res = {}
    for i in range(2,int(n**.5)+1):
        if n % i == 0:
            r = 0  # nがiで何回割り切れるか
            while n % i == 0:
                n //= i
                r += 1
            res[i] = r
    if n != 1:
        res[n] = 1
    return res


N = I()
X = prime_factorization(N).values()
a = 0
for x in X:
    a ^= x

if a == 0:
    print('Bob')
else:
    print('Alice')
0