結果

問題 No.2 素因数ゲーム
ユーザー EguyEguy
提出日時 2022-07-17 12:03:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 79 ms / 5,000 ms
コード長 676 bytes
コンパイル時間 423 ms
コンパイル使用メモリ 87,212 KB
実行使用メモリ 75,588 KB
最終ジャッジ日時 2023-09-11 23:56:06
合計ジャッジ時間 4,764 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,256 KB
testcase_01 AC 75 ms
71,212 KB
testcase_02 AC 73 ms
71,144 KB
testcase_03 AC 73 ms
71,316 KB
testcase_04 AC 74 ms
71,504 KB
testcase_05 AC 76 ms
71,460 KB
testcase_06 AC 75 ms
70,952 KB
testcase_07 AC 74 ms
71,356 KB
testcase_08 AC 74 ms
75,480 KB
testcase_09 AC 73 ms
71,308 KB
testcase_10 AC 73 ms
71,552 KB
testcase_11 AC 73 ms
71,468 KB
testcase_12 AC 74 ms
71,104 KB
testcase_13 AC 72 ms
71,264 KB
testcase_14 AC 74 ms
71,472 KB
testcase_15 AC 76 ms
75,208 KB
testcase_16 AC 76 ms
75,436 KB
testcase_17 AC 73 ms
71,268 KB
testcase_18 AC 73 ms
71,144 KB
testcase_19 AC 77 ms
75,516 KB
testcase_20 AC 76 ms
75,516 KB
testcase_21 AC 76 ms
75,440 KB
testcase_22 AC 76 ms
75,456 KB
testcase_23 AC 74 ms
71,104 KB
testcase_24 AC 76 ms
75,536 KB
testcase_25 AC 79 ms
75,588 KB
testcase_26 AC 73 ms
71,256 KB
testcase_27 AC 72 ms
71,212 KB
testcase_28 AC 72 ms
71,500 KB
testcase_29 AC 73 ms
71,556 KB
testcase_30 AC 75 ms
75,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, math
sys.setrecursionlimit(1000000)
INF = 1 << 100
#mod = 1000000007
mod = 998244353
input = lambda: sys.stdin.readline().rstrip()
li = lambda: list(map(int, input().split()))

def factorization(x):
    lst = []
    if x == 1:
        return lst
    
    for n in range(2, x + 1):
        if n * n > x or x == 1:
            break
        count = 0
        while x % n == 0:
            x //= n
            count += 1
        if count:
            lst.append((n, count))

    if x > 1:
        lst.append((x, 1))

    return lst

N = int(input())
fact = factorization(N)
x = 0
for _, i in fact:
    x ^= i

if x:
    ans = 'Alice'
else:
    ans = 'Bob'

print(ans)
0