結果

問題 No.103 素因数ゲーム リターンズ
ユーザー ああいい
提出日時 2021-12-29 15:54:35
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 35 ms / 5,000 ms
コード長 476 bytes
コンパイル時間 346 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-10-04 00:25:57
合計ジャッジ時間 1,831 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 5
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dat = [0] * 10 ** 4
prime = []
i = 2
while i < 10 ** 4:
    if dat[i] == 0:
        prime.append(i)
        for j in range(i * 2,10 ** 4,i):
            dat[j] = 1
    i += 1
ans = 0
for m in M:
    for p in prime:
        count = 0
        while m % p == 0:
            count += 1
            m = m // p
        ans ^= (count % 3)
        if m == 1:
            break
if ans == 0:
    print('Bob')
else:
    print('Alice')
0