結果

問題 No.2 素因数ゲーム
ユーザー roarisroaris
提出日時 2019-08-23 08:43:54
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 1,056 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 57,856 KB
最終ジャッジ日時 2024-04-21 15:28:44
合計ジャッジ時間 3,624 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
52,224 KB
testcase_01 AC 48 ms
52,352 KB
testcase_02 AC 49 ms
52,224 KB
testcase_03 AC 47 ms
51,840 KB
testcase_04 AC 48 ms
52,352 KB
testcase_05 AC 51 ms
52,224 KB
testcase_06 AC 51 ms
57,216 KB
testcase_07 AC 50 ms
57,360 KB
testcase_08 AC 50 ms
57,344 KB
testcase_09 AC 51 ms
57,472 KB
testcase_10 AC 53 ms
57,600 KB
testcase_11 AC 52 ms
57,600 KB
testcase_12 AC 53 ms
57,344 KB
testcase_13 AC 51 ms
57,464 KB
testcase_14 AC 50 ms
57,088 KB
testcase_15 AC 52 ms
57,216 KB
testcase_16 AC 51 ms
57,216 KB
testcase_17 AC 51 ms
57,600 KB
testcase_18 AC 53 ms
57,856 KB
testcase_19 AC 53 ms
57,472 KB
testcase_20 AC 55 ms
57,472 KB
testcase_21 AC 54 ms
57,344 KB
testcase_22 AC 51 ms
57,472 KB
testcase_23 AC 52 ms
57,344 KB
testcase_24 AC 50 ms
57,728 KB
testcase_25 AC 51 ms
57,856 KB
testcase_26 AC 52 ms
57,856 KB
testcase_27 AC 53 ms
57,472 KB
testcase_28 AC 51 ms
57,472 KB
testcase_29 AC 53 ms
57,216 KB
testcase_30 AC 52 ms
57,600 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def factorize(n):
    factors = []
    
    for i in range(2, int(n**0.5) + 1):
        cnt = 0
        
        while n % i == 0:
            n //= i
            cnt += 1
        
        if cnt > 0:
            factors.append((i, cnt))
    
    if n > 1:
        factors.append((n, 1))
    
    return factors

N = int(input())
factors = factorize(N)
xor = factors[0][1]

for _, value in factors[1:]:
    xor ^= value

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