結果

問題 No.2 素因数ゲーム
ユーザー snnekosnneko
提出日時 2019-03-18 06:32:55
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 239 ms / 5,000 ms
コード長 642 bytes
コンパイル時間 134 ms
コンパイル使用メモリ 10,940 KB
実行使用メモリ 29,660 KB
最終ジャッジ日時 2023-08-27 05:00:34
合計ジャッジ時間 7,704 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 135 ms
29,576 KB
testcase_01 AC 138 ms
29,556 KB
testcase_02 AC 138 ms
29,532 KB
testcase_03 AC 135 ms
29,660 KB
testcase_04 AC 138 ms
29,452 KB
testcase_05 AC 137 ms
29,568 KB
testcase_06 AC 137 ms
29,572 KB
testcase_07 AC 136 ms
29,504 KB
testcase_08 AC 140 ms
29,516 KB
testcase_09 AC 135 ms
29,568 KB
testcase_10 AC 134 ms
29,484 KB
testcase_11 AC 137 ms
29,436 KB
testcase_12 AC 135 ms
29,484 KB
testcase_13 AC 137 ms
29,544 KB
testcase_14 AC 136 ms
29,564 KB
testcase_15 AC 147 ms
29,544 KB
testcase_16 AC 142 ms
29,568 KB
testcase_17 AC 142 ms
29,472 KB
testcase_18 AC 137 ms
29,520 KB
testcase_19 AC 197 ms
29,512 KB
testcase_20 AC 182 ms
29,484 KB
testcase_21 AC 239 ms
29,568 KB
testcase_22 AC 142 ms
29,520 KB
testcase_23 AC 136 ms
29,496 KB
testcase_24 AC 142 ms
29,532 KB
testcase_25 AC 143 ms
29,496 KB
testcase_26 AC 137 ms
29,592 KB
testcase_27 AC 135 ms
29,476 KB
testcase_28 AC 138 ms
29,548 KB
testcase_29 AC 142 ms
29,608 KB
testcase_30 AC 162 ms
29,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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
    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

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