結果

問題 No.2 素因数ゲーム
ユーザー sotanishysotanishy
提出日時 2021-03-16 19:40:34
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 529 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 87,148 KB
実行使用メモリ 75,524 KB
最終ジャッジ日時 2023-08-08 03:32:17
合計ジャッジ時間 4,366 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,400 KB
testcase_01 AC 75 ms
71,408 KB
testcase_02 AC 74 ms
71,340 KB
testcase_03 AC 74 ms
71,464 KB
testcase_04 AC 74 ms
71,536 KB
testcase_05 AC 75 ms
71,400 KB
testcase_06 AC 75 ms
71,076 KB
testcase_07 AC 74 ms
71,460 KB
testcase_08 AC 75 ms
71,352 KB
testcase_09 AC 76 ms
71,444 KB
testcase_10 AC 76 ms
71,652 KB
testcase_11 AC 75 ms
71,500 KB
testcase_12 AC 76 ms
71,152 KB
testcase_13 AC 74 ms
71,396 KB
testcase_14 AC 75 ms
71,156 KB
testcase_15 AC 77 ms
75,448 KB
testcase_16 AC 73 ms
71,368 KB
testcase_17 AC 74 ms
71,332 KB
testcase_18 AC 74 ms
71,208 KB
testcase_19 AC 76 ms
75,496 KB
testcase_20 AC 76 ms
75,328 KB
testcase_21 AC 74 ms
75,524 KB
testcase_22 AC 73 ms
71,316 KB
testcase_23 AC 74 ms
71,552 KB
testcase_24 AC 74 ms
71,204 KB
testcase_25 AC 74 ms
71,064 KB
testcase_26 AC 71 ms
71,528 KB
testcase_27 AC 73 ms
71,156 KB
testcase_28 AC 74 ms
71,488 KB
testcase_29 AC 73 ms
71,160 KB
testcase_30 AC 75 ms
75,192 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def prime_factor(n):
    factors = {}
    if n % 2 == 0:
        cnt = 0
        while n % 2 == 0:
            cnt += 1
            n //= 2
        factors[2] = cnt
    i = 3
    while i * i <= n:
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            factors[i] = cnt
        i += 2
    if n != 1:
        factors[n] = 1
    return factors

N = int(input())
xor = 0
for p, c in prime_factor(N).items():
    xor ^= c
print('Alice' if xor else 'Bob')
0