結果

問題 No.103 素因数ゲーム リターンズ
ユーザー roarisroaris
提出日時 2020-11-25 23:56:49
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 92 ms / 5,000 ms
コード長 513 bytes
コンパイル時間 372 ms
コンパイル使用メモリ 86,688 KB
実行使用メモリ 75,960 KB
最終ジャッジ日時 2023-10-01 02:02:59
合計ジャッジ時間 4,128 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,472 KB
testcase_01 AC 71 ms
71,240 KB
testcase_02 AC 72 ms
71,544 KB
testcase_03 AC 72 ms
71,072 KB
testcase_04 AC 70 ms
71,508 KB
testcase_05 AC 72 ms
71,276 KB
testcase_06 AC 73 ms
71,328 KB
testcase_07 AC 74 ms
71,448 KB
testcase_08 AC 72 ms
71,360 KB
testcase_09 AC 75 ms
71,512 KB
testcase_10 AC 75 ms
71,452 KB
testcase_11 AC 74 ms
71,440 KB
testcase_12 AC 91 ms
75,540 KB
testcase_13 AC 76 ms
75,772 KB
testcase_14 AC 92 ms
75,960 KB
testcase_15 AC 77 ms
75,536 KB
testcase_16 AC 76 ms
71,492 KB
testcase_17 AC 78 ms
75,516 KB
testcase_18 AC 76 ms
75,760 KB
testcase_19 AC 78 ms
75,432 KB
testcase_20 AC 79 ms
75,616 KB
testcase_21 AC 80 ms
75,768 KB
testcase_22 AC 81 ms
75,292 KB
testcase_23 AC 79 ms
75,564 KB
testcase_24 AC 79 ms
75,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline

def factorize(n):
    fct = []
    
    for i in range(2, int(n**0.5)+1):
        c = 0
        
        while n%i==0:
            n //= i
            c += 1
            
        if c>0:
            fct.append((i, c))
    
    if n>1:
        fct.append((n, 1))
    
    return fct

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

for Mi in M:
    fct = factorize(Mi)
    
    for _, c in fct:
        G ^= c%3

if G==0:
    print('Bob')
else:
    print('Alice')
0