結果

問題 No.2 素因数ゲーム
ユーザー HydruHydru
提出日時 2021-11-12 01:06:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 672 bytes
コンパイル時間 243 ms
コンパイル使用メモリ 82,536 KB
実行使用メモリ 59,384 KB
最終ジャッジ日時 2024-05-03 04:05:42
合計ジャッジ時間 2,346 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,824 KB
testcase_01 AC 42 ms
53,052 KB
testcase_02 AC 39 ms
54,216 KB
testcase_03 AC 39 ms
54,064 KB
testcase_04 AC 35 ms
52,672 KB
testcase_05 AC 37 ms
52,788 KB
testcase_06 AC 40 ms
58,308 KB
testcase_07 AC 37 ms
52,660 KB
testcase_08 AC 39 ms
58,900 KB
testcase_09 AC 38 ms
53,396 KB
testcase_10 AC 36 ms
53,460 KB
testcase_11 AC 36 ms
53,156 KB
testcase_12 AC 35 ms
53,848 KB
testcase_13 AC 35 ms
52,964 KB
testcase_14 AC 35 ms
52,832 KB
testcase_15 AC 37 ms
58,324 KB
testcase_16 AC 39 ms
58,640 KB
testcase_17 AC 41 ms
58,176 KB
testcase_18 AC 40 ms
57,684 KB
testcase_19 AC 40 ms
58,260 KB
testcase_20 AC 39 ms
58,040 KB
testcase_21 AC 39 ms
58,608 KB
testcase_22 AC 36 ms
53,816 KB
testcase_23 AC 36 ms
59,384 KB
testcase_24 AC 37 ms
58,152 KB
testcase_25 AC 36 ms
58,716 KB
testcase_26 AC 36 ms
58,304 KB
testcase_27 AC 39 ms
58,392 KB
testcase_28 AC 39 ms
57,500 KB
testcase_29 AC 38 ms
58,556 KB
testcase_30 AC 37 ms
58,328 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorization(n):
    if n==1:
        return []
    arr = []
    tmp = n
    for i in range(2,4):
        if tmp%i==0:
                cnt=0
                while(tmp%i==0):
                    cnt+=1
                    tmp//=i
                arr.append(cnt)
    for i in range(5, int(-(-tmp**0.5//1))+1,2):
        if tmp%i==0:
            cnt=0
            while tmp%i==0:
                cnt+=1
                tmp //= i
            arr.append(cnt)

    if tmp!=1:
        arr.append(1)

    if arr==[]:
        arr.append(1)

    return arr
n=int(input())
prime=factorization(n)
ans=0
for x in prime:
    ans^=x
if ans:
    print("Alice")
else:
    print("Bob")
0