結果

問題 No.2 素因数ゲーム
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2020-01-21 01:18:51
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 816 bytes
コンパイル時間 1,043 ms
コンパイル使用メモリ 10,816 KB
実行使用メモリ 7,932 KB
最終ジャッジ日時 2023-09-15 22:11:24
合計ジャッジ時間 2,394 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,716 KB
testcase_01 AC 15 ms
7,800 KB
testcase_02 AC 16 ms
7,728 KB
testcase_03 AC 16 ms
7,728 KB
testcase_04 AC 16 ms
7,788 KB
testcase_05 AC 15 ms
7,740 KB
testcase_06 AC 16 ms
7,872 KB
testcase_07 AC 15 ms
7,692 KB
testcase_08 AC 16 ms
7,724 KB
testcase_09 AC 16 ms
7,772 KB
testcase_10 AC 17 ms
7,728 KB
testcase_11 AC 17 ms
7,760 KB
testcase_12 AC 15 ms
7,776 KB
testcase_13 AC 15 ms
7,720 KB
testcase_14 AC 15 ms
7,832 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 15 ms
7,724 KB
testcase_18 AC 15 ms
7,760 KB
testcase_19 AC 15 ms
7,836 KB
testcase_20 AC 15 ms
7,820 KB
testcase_21 AC 15 ms
7,764 KB
testcase_22 AC 15 ms
7,760 KB
testcase_23 AC 15 ms
7,832 KB
testcase_24 WA -
testcase_25 AC 16 ms
7,804 KB
testcase_26 AC 15 ms
7,776 KB
testcase_27 AC 15 ms
7,764 KB
testcase_28 AC 15 ms
7,724 KB
testcase_29 AC 16 ms
7,692 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def Sieve(n): #n以下の素数全列挙(O(nloglogn)) retは素数が入ってる。divlisはその数字の素因数が一つ入ってる

    ret = []
    divlis = [-1] * (n+1) #何で割ったかのリスト(初期値は-1)
    
    flag = [True] * (n+1)
    flag[0] = False
    flag[1] = False

    ind = 2
    while ind <= n:

        if flag[ind]:
            ret.append(ind)

            ind2 = ind ** 2

            while ind2 <= n:
                flag[ind2] = False
                divlis[ind2] = ind
                ind2 += ind

        ind += 1

    return ret,divlis


N = int(input())

ret,divs = Sieve(1000)

ans = 0

for i in ret:

    now = 0

    while N % i == 0:
        N //= i
        now += 1

    ans ^= now

if N != 1:
    ans ^= 1

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