結果

問題 No.103 素因数ゲーム リターンズ
ユーザー s_shoheis_shohei
提出日時 2021-09-27 20:49:50
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 80 ms / 5,000 ms
コード長 534 bytes
コンパイル時間 332 ms
コンパイル使用メモリ 87,184 KB
実行使用メモリ 76,088 KB
最終ジャッジ日時 2023-09-20 22:15:40
合計ジャッジ時間 3,747 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 80 ms
71,680 KB
testcase_01 AC 74 ms
71,652 KB
testcase_02 AC 79 ms
71,792 KB
testcase_03 AC 79 ms
71,512 KB
testcase_04 AC 75 ms
71,752 KB
testcase_05 AC 77 ms
71,760 KB
testcase_06 AC 76 ms
71,648 KB
testcase_07 AC 75 ms
71,836 KB
testcase_08 AC 74 ms
71,748 KB
testcase_09 AC 75 ms
71,792 KB
testcase_10 AC 78 ms
71,788 KB
testcase_11 AC 74 ms
71,752 KB
testcase_12 AC 77 ms
75,640 KB
testcase_13 AC 76 ms
75,684 KB
testcase_14 AC 78 ms
75,576 KB
testcase_15 AC 77 ms
75,664 KB
testcase_16 AC 74 ms
71,876 KB
testcase_17 AC 78 ms
75,692 KB
testcase_18 AC 78 ms
75,428 KB
testcase_19 AC 77 ms
75,776 KB
testcase_20 AC 78 ms
75,524 KB
testcase_21 AC 77 ms
76,088 KB
testcase_22 AC 77 ms
75,780 KB
testcase_23 AC 77 ms
75,696 KB
testcase_24 AC 77 ms
75,540 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
a = list(map(int, input().split()))
def fact(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append(cnt)
    if temp!=1:
        arr.append(1)
    if arr==[]:
        arr.append(1)
    return arr

xor=0
for num in a:
    g_sub=0
    f=fact(num)
    for e in f:
        g_sub ^= (e%3)

    xor ^= g_sub

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