結果

問題 No.103 素因数ゲーム リターンズ
ユーザー dice4084dice4084
提出日時 2023-01-02 22:32:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 81 ms / 5,000 ms
コード長 423 bytes
コンパイル時間 1,549 ms
コンパイル使用メモリ 87,032 KB
実行使用メモリ 76,144 KB
最終ジャッジ日時 2023-08-17 23:54:01
合計ジャッジ時間 3,656 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,908 KB
testcase_01 AC 74 ms
71,664 KB
testcase_02 AC 77 ms
71,664 KB
testcase_03 AC 73 ms
71,488 KB
testcase_04 AC 74 ms
71,544 KB
testcase_05 AC 74 ms
71,876 KB
testcase_06 AC 75 ms
71,492 KB
testcase_07 AC 74 ms
71,820 KB
testcase_08 AC 74 ms
71,492 KB
testcase_09 AC 74 ms
71,744 KB
testcase_10 AC 74 ms
71,548 KB
testcase_11 AC 73 ms
71,648 KB
testcase_12 AC 76 ms
75,692 KB
testcase_13 AC 76 ms
75,844 KB
testcase_14 AC 79 ms
76,144 KB
testcase_15 AC 81 ms
75,940 KB
testcase_16 AC 77 ms
71,688 KB
testcase_17 AC 80 ms
75,808 KB
testcase_18 AC 79 ms
76,084 KB
testcase_19 AC 77 ms
75,844 KB
testcase_20 AC 77 ms
75,984 KB
testcase_21 AC 76 ms
75,880 KB
testcase_22 AC 78 ms
75,920 KB
testcase_23 AC 76 ms
75,904 KB
testcase_24 AC 78 ms
76,000 KB
権限があれば一括ダウンロードができます

ソースコード

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