結果

問題 No.103 素因数ゲーム リターンズ
ユーザー 佐藤悠佐藤悠
提出日時 2023-05-21 11:09:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 604 bytes
コンパイル時間 768 ms
コンパイル使用メモリ 87,000 KB
実行使用メモリ 77,628 KB
最終ジャッジ日時 2023-08-23 14:46:18
合計ジャッジ時間 4,814 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 99 ms
71,588 KB
testcase_01 AC 99 ms
71,448 KB
testcase_02 AC 102 ms
71,548 KB
testcase_03 AC 98 ms
71,764 KB
testcase_04 AC 97 ms
71,796 KB
testcase_05 AC 98 ms
71,484 KB
testcase_06 AC 97 ms
71,888 KB
testcase_07 AC 97 ms
71,480 KB
testcase_08 AC 95 ms
71,644 KB
testcase_09 AC 94 ms
71,496 KB
testcase_10 AC 99 ms
71,808 KB
testcase_11 AC 98 ms
71,640 KB
testcase_12 AC 110 ms
77,064 KB
testcase_13 AC 104 ms
76,796 KB
testcase_14 AC 106 ms
77,104 KB
testcase_15 AC 106 ms
77,112 KB
testcase_16 AC 98 ms
71,760 KB
testcase_17 AC 104 ms
77,092 KB
testcase_18 AC 99 ms
71,692 KB
testcase_19 AC 111 ms
77,628 KB
testcase_20 AC 99 ms
71,380 KB
testcase_21 AC 97 ms
71,508 KB
testcase_22 AC 100 ms
71,888 KB
testcase_23 AC 97 ms
71,948 KB
testcase_24 AC 98 ms
71,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

gru = [0]*(11)
for i in range(1,11):
    me = []
    for j in range(1,3):
        if i-j >= 0:
            me.append(gru[i-j])
    ans = 0
    while ans in me:
        ans+=1
    gru[i] = ans
n = int(input())
m = list(map(int,input().split()))
from collections import defaultdict
we = 0
for i in m:

    nd = defaultdict(int)
    con = 2
    while con**2 <= i:
        if i%con == 0:
            nd[con] +=1
            i /= con
        else:
            con+=1
    if i != 1:
        nd[i]+=1
    ans = 0
    for j in nd:
        ans = ans^gru[nd[j]]
    we = we^ans
print("Alice" if we != 0 else "Bob")
0