結果

問題 No.2 素因数ゲーム
ユーザー snnekosnneko
提出日時 2019-03-18 06:05:19
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 547 bytes
コンパイル時間 82 ms
コンパイル使用メモリ 10,920 KB
実行使用メモリ 13,140 KB
最終ジャッジ日時 2023-09-22 23:49:28
合計ジャッジ時間 7,179 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,844 KB
testcase_01 AC 16 ms
7,948 KB
testcase_02 AC 17 ms
7,848 KB
testcase_03 AC 16 ms
7,904 KB
testcase_04 AC 16 ms
7,852 KB
testcase_05 AC 15 ms
7,812 KB
testcase_06 AC 15 ms
7,816 KB
testcase_07 AC 17 ms
7,772 KB
testcase_08 TLE -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

p_list = list()
c_list = list()
prime = [2, 0]
while N != 1:
    while N%prime[0] == 0:
        N = int(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
        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