結果

問題 No.2 素因数ゲーム
ユーザー ynyn
提出日時 2015-10-05 00:25:43
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 10,824 KB
実行使用メモリ 8,372 KB
最終ジャッジ日時 2023-09-27 02:03:46
合計ジャッジ時間 3,322 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 21 ms
8,356 KB
testcase_01 AC 22 ms
8,372 KB
testcase_02 AC 22 ms
8,268 KB
testcase_03 AC 22 ms
8,332 KB
testcase_04 AC 22 ms
8,304 KB
testcase_05 AC 22 ms
8,188 KB
testcase_06 AC 21 ms
8,064 KB
testcase_07 AC 23 ms
8,176 KB
testcase_08 WA -
testcase_09 AC 22 ms
8,224 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 22 ms
8,092 KB
testcase_13 AC 21 ms
8,072 KB
testcase_14 AC 54 ms
8,016 KB
testcase_15 AC 53 ms
8,176 KB
testcase_16 WA -
testcase_17 AC 53 ms
8,108 KB
testcase_18 AC 28 ms
8,084 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 24 ms
8,024 KB
testcase_27 AC 23 ms
8,040 KB
testcase_28 AC 22 ms
8,100 KB
testcase_29 AC 22 ms
8,104 KB
testcase_30 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

def solve(n, num):
    count = []
    for i in num:
        if n < i:
            break

        cnt = 0
        while n % i == 0:
            n = n // i
            #d.append(i)
            #d_set.add(i)
            cnt += 1
        count.append(cnt)

        x = 0
        for j in range(len(count)):
            x ^= count[j]

    if x == 0:
        return False
    else:
        return True

M = 10000
table = [True] * (M + 1)
num = []

for i in range(2, M + 1):
    if not table[i]:
        continue
    k = i + i
    while k < M + 1:
        table[k] = False
        k += i

    num.append(i)

n = int(input())
if solve(n, num):
    print("Alice")
else:
    print("Bob")
0