結果

問題 No.103 素因数ゲーム リターンズ
コンテスト
ユーザー dice4084
提出日時 2023-01-02 22:32:50
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 420 ms
コンパイル使用メモリ 85,276 KB
実行使用メモリ 58,752 KB
最終ジャッジ日時 2026-05-21 08:22:21
合計ジャッジ時間 2,381 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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