結果

問題 No.103 素因数ゲーム リターンズ
ユーザー brthyyjpbrthyyjp
提出日時 2021-03-27 19:04:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 77 ms / 5,000 ms
コード長 586 bytes
コンパイル時間 2,411 ms
コンパイル使用メモリ 86,672 KB
実行使用メモリ 75,520 KB
最終ジャッジ日時 2023-08-19 14:58:20
合計ジャッジ時間 4,175 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,264 KB
testcase_01 AC 68 ms
71,132 KB
testcase_02 AC 66 ms
71,020 KB
testcase_03 AC 66 ms
71,312 KB
testcase_04 AC 66 ms
71,208 KB
testcase_05 AC 68 ms
70,900 KB
testcase_06 AC 68 ms
71,316 KB
testcase_07 AC 67 ms
71,132 KB
testcase_08 AC 66 ms
71,284 KB
testcase_09 AC 66 ms
71,200 KB
testcase_10 AC 67 ms
70,900 KB
testcase_11 AC 68 ms
71,216 KB
testcase_12 AC 71 ms
75,356 KB
testcase_13 AC 71 ms
75,056 KB
testcase_14 AC 77 ms
75,520 KB
testcase_15 AC 71 ms
75,484 KB
testcase_16 AC 68 ms
71,220 KB
testcase_17 AC 70 ms
75,172 KB
testcase_18 AC 71 ms
75,416 KB
testcase_19 AC 69 ms
75,216 KB
testcase_20 AC 70 ms
75,424 KB
testcase_21 AC 72 ms
75,188 KB
testcase_22 AC 71 ms
75,108 KB
testcase_23 AC 70 ms
74,972 KB
testcase_24 AC 70 ms
75,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
M = list(map(int, input().split()))

import math
def factorize(n):
    d = {}
    temp = int(math.sqrt(n))+1
    for i in range(2, temp):
        while n%i== 0:
            n //= i
            if i in d:
                d[i] += 1
            else:
                d[i] = 1
    if d == {}:
        d[n] = 1
    else:
        if n in d:
            d[n] += 1
        elif n != 1:
            d[n] =1
    return d

t = 0
for m in M:
    d = factorize(m)
    a = 0
    for k, v in d.items():
        a ^= v%3
    t ^= a
if t == 0:
    print('Bob')
else:
    print('Alice')
0