結果

問題 No.2 素因数ゲーム
ユーザー lie_of_lillielie_of_lillie
提出日時 2021-06-12 00:01:28
言語 Python3
(3.11.6 + numpy 1.26.0 + scipy 1.11.3)
結果
AC  
実行時間 20 ms / 5,000 ms
コード長 480 bytes
コンパイル時間 480 ms
コンパイル使用メモリ 10,456 KB
実行使用メモリ 8,664 KB
最終ジャッジ日時 2023-08-21 15:15:34
合計ジャッジ時間 2,155 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,596 KB
testcase_01 AC 19 ms
8,536 KB
testcase_02 AC 20 ms
8,472 KB
testcase_03 AC 20 ms
8,504 KB
testcase_04 AC 19 ms
8,648 KB
testcase_05 AC 19 ms
8,596 KB
testcase_06 AC 19 ms
8,468 KB
testcase_07 AC 19 ms
8,664 KB
testcase_08 AC 19 ms
8,644 KB
testcase_09 AC 19 ms
8,640 KB
testcase_10 AC 19 ms
8,636 KB
testcase_11 AC 19 ms
8,540 KB
testcase_12 AC 19 ms
8,644 KB
testcase_13 AC 20 ms
8,640 KB
testcase_14 AC 19 ms
8,656 KB
testcase_15 AC 19 ms
8,468 KB
testcase_16 AC 19 ms
8,460 KB
testcase_17 AC 20 ms
8,648 KB
testcase_18 AC 19 ms
8,640 KB
testcase_19 AC 20 ms
8,600 KB
testcase_20 AC 19 ms
8,596 KB
testcase_21 AC 20 ms
8,460 KB
testcase_22 AC 19 ms
8,532 KB
testcase_23 AC 19 ms
8,640 KB
testcase_24 AC 19 ms
8,460 KB
testcase_25 AC 19 ms
8,536 KB
testcase_26 AC 19 ms
8,468 KB
testcase_27 AC 19 ms
8,656 KB
testcase_28 AC 20 ms
8,664 KB
testcase_29 AC 19 ms
8,468 KB
testcase_30 AC 19 ms
8,600 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
import collections
import functools
N=int(input())
ps=prime_factorize(N)
#print(ps)

r=functools.reduce(lambda x,y:x^y, collections.Counter(ps).values())

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