結果

問題 No.103 素因数ゲーム リターンズ
ユーザー dice4084
提出日時 2023-01-02 22:32:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 303 ms
コンパイル使用メモリ 81,664 KB
実行使用メモリ 57,984 KB
最終ジャッジ日時 2024-11-27 01:23:15
合計ジャッジ時間 2,146 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline


def sub_grundy(k):
    sub_xor = 0
    for i in range(2, int(k**0.5) + 1):
        tmp = 0
        while k % i == 0:
            k //= i
            tmp += 1
        sub_xor ^= tmp % 3

    if k > 1:
        sub_xor ^= 1
    return sub_xor


n = int(input())
m = list(map(int, input().split()))
xor = 0

for mi in m:
    xor ^= sub_grundy(mi)

print("Alice" if xor != 0 else "Bob")
0