結果

問題 No.2 素因数ゲーム
ユーザー 双六双六
提出日時 2020-07-25 23:31:53
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 111 ms / 5,000 ms
コード長 771 bytes
コンパイル時間 285 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 78,400 KB
最終ジャッジ日時 2023-09-10 02:11:08
合計ジャッジ時間 5,460 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 105 ms
78,148 KB
testcase_01 AC 103 ms
78,332 KB
testcase_02 AC 108 ms
78,236 KB
testcase_03 AC 108 ms
77,968 KB
testcase_04 AC 106 ms
78,236 KB
testcase_05 AC 106 ms
77,960 KB
testcase_06 AC 106 ms
78,240 KB
testcase_07 AC 107 ms
78,184 KB
testcase_08 AC 106 ms
78,276 KB
testcase_09 AC 105 ms
78,008 KB
testcase_10 AC 108 ms
78,180 KB
testcase_11 AC 108 ms
78,172 KB
testcase_12 AC 107 ms
78,232 KB
testcase_13 AC 104 ms
78,400 KB
testcase_14 AC 109 ms
78,124 KB
testcase_15 AC 106 ms
78,004 KB
testcase_16 AC 107 ms
78,236 KB
testcase_17 AC 110 ms
78,116 KB
testcase_18 AC 107 ms
78,264 KB
testcase_19 AC 107 ms
78,296 KB
testcase_20 AC 107 ms
78,248 KB
testcase_21 AC 108 ms
78,140 KB
testcase_22 AC 105 ms
78,140 KB
testcase_23 AC 108 ms
78,148 KB
testcase_24 AC 108 ms
78,320 KB
testcase_25 AC 108 ms
78,156 KB
testcase_26 AC 107 ms
78,392 KB
testcase_27 AC 111 ms
78,180 KB
testcase_28 AC 107 ms
78,124 KB
testcase_29 AC 106 ms
77,952 KB
testcase_30 AC 106 ms
78,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))


num = 10 ** 5 + 1
L = [1 for i in range(num)]; L[0] = 0; L[1] = 0
plist = []
for i in range(num):
	if L[i] == 1:
		plist.append(i); c = 2
		while i * c <= num - 1:
			L[i * c] = 0; c += 1

def prime_factorization(N):
	D = defaultdict(int)
	for i in plist:
		while N % i == 0:
			D[i] += 1; N = int(N // i)

	if N != 1:
		D[N] += 1

	return D

#処理内容
def main():
	N = int(input())
	fac = prime_factorization(N)
	XOR = 0
	for key, value in fac.items():
		XOR ^= value

	if XOR != 0:
		print("Alice")
	else:
		print("Bob")



if __name__ == '__main__':
	main()
0