結果

問題 No.2 素因数ゲーム
ユーザー snnekosnneko
提出日時 2019-03-18 06:31:14
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 749 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 10,952 KB
実行使用メモリ 29,668 KB
最終ジャッジ日時 2023-09-23 00:43:51
合計ジャッジ時間 8,041 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 138 ms
29,572 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 135 ms
29,608 KB
testcase_04 AC 134 ms
29,632 KB
testcase_05 WA -
testcase_06 AC 136 ms
29,560 KB
testcase_07 WA -
testcase_08 AC 136 ms
29,512 KB
testcase_09 AC 136 ms
29,616 KB
testcase_10 AC 135 ms
29,500 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 137 ms
29,592 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 AC 137 ms
29,488 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 137 ms
29,660 KB
testcase_24 AC 138 ms
29,632 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 132 ms
29,564 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#S = list(map(int, input().split()))
import numpy as np
N = int(input())

p_list = list()
c_list = list()
prime = [2, 0]
while N != 1:
    while N % prime[0] == 0:
        N //= prime[0]
        prime[1] += 1
    if N >= 1:
        prime[0] = N
        prime[1] = 1

    p_list.append(prime[0])
    c_list.append(prime[1])
    if N == 1: break

    prime[1] = 0
    while True:
        prime[0] += 1
        if np.sqrt(N) < prime[0]:
            prime[0] = N
            break
        flg = 0
        for p in p_list:
            if prime[0] % p == 0:
                flg = 1
                break
        if flg == 0:
            break

ans = 0
for c in c_list:
    ans = ans ^ c

# c_list[0]
if ans == 0:
    print('Bob')
else:
    print('Alice')
0