結果

問題 No.103 素因数ゲーム リターンズ
ユーザー tonyu0
提出日時 2020-09-26 13:11:28
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 5,000 ms
コード長 388 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-06-29 00:06:21
合計ジャッジ時間 1,878 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

m = int(input())
a = list(map(int, input().split()))
all = 0
for n in a:
    d = dict()
    for i in range(2, int(n**0.5)+1):
        if n % i == 0:
            d[i] = 0
            while n % i == 0:
                n /= i
                d[i] += 1
    if n != 1:
        d[n] = 1

    xor = 0
    for b in d.values():
        xor ^= b % 3
    all ^= xor
print("Alice" if all else "Bob")
0