結果

問題 No.2 素因数ゲーム
ユーザー alexara1123alexara1123
提出日時 2019-09-03 18:04:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 5,000 ms
コード長 575 bytes
コンパイル時間 988 ms
コンパイル使用メモリ 87,108 KB
実行使用メモリ 75,644 KB
最終ジャッジ日時 2023-08-25 22:11:27
合計ジャッジ時間 3,951 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,344 KB
testcase_01 AC 59 ms
71,316 KB
testcase_02 AC 59 ms
71,240 KB
testcase_03 AC 60 ms
71,180 KB
testcase_04 AC 58 ms
71,492 KB
testcase_05 AC 59 ms
71,200 KB
testcase_06 AC 61 ms
71,108 KB
testcase_07 AC 61 ms
71,416 KB
testcase_08 AC 59 ms
75,468 KB
testcase_09 AC 59 ms
71,176 KB
testcase_10 AC 60 ms
71,036 KB
testcase_11 AC 60 ms
71,312 KB
testcase_12 AC 60 ms
71,072 KB
testcase_13 AC 58 ms
71,336 KB
testcase_14 AC 59 ms
71,452 KB
testcase_15 AC 59 ms
75,504 KB
testcase_16 AC 60 ms
75,576 KB
testcase_17 AC 58 ms
71,696 KB
testcase_18 AC 57 ms
71,216 KB
testcase_19 AC 61 ms
75,464 KB
testcase_20 AC 62 ms
75,448 KB
testcase_21 AC 61 ms
75,548 KB
testcase_22 AC 61 ms
75,416 KB
testcase_23 AC 61 ms
71,276 KB
testcase_24 AC 69 ms
75,548 KB
testcase_25 AC 68 ms
75,580 KB
testcase_26 AC 64 ms
71,248 KB
testcase_27 AC 63 ms
71,468 KB
testcase_28 AC 63 ms
71,540 KB
testcase_29 AC 60 ms
71,332 KB
testcase_30 AC 61 ms
75,644 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)



def factorize(n):
    fct = []  
    b, e = 2, 0 
    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


def main():
    n = int(input())
    l = factorize(n)
    nim = 0
    for i in range(len(l)):
        nim ^= l[i][1]

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


if __name__ == '__main__':
    main()
0