結果

問題 No.2 素因数ゲーム
ユーザー KoshStormKoshStorm
提出日時 2018-03-12 12:25:54
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 465 bytes
コンパイル時間 126 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,256 KB
最終ジャッジ日時 2024-04-25 02:24:49
合計ジャッジ時間 8,368 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 30 ms
10,752 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,752 KB
testcase_06 AC 30 ms
10,752 KB
testcase_07 AC 30 ms
10,880 KB
testcase_08 AC 641 ms
10,880 KB
testcase_09 AC 30 ms
10,880 KB
testcase_10 AC 35 ms
10,880 KB
testcase_11 AC 37 ms
10,752 KB
testcase_12 AC 29 ms
10,752 KB
testcase_13 AC 29 ms
10,880 KB
testcase_14 AC 37 ms
10,752 KB
testcase_15 AC 32 ms
10,880 KB
testcase_16 AC 34 ms
10,880 KB
testcase_17 AC 96 ms
10,752 KB
testcase_18 AC 30 ms
10,752 KB
testcase_19 TLE -
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())
def factoring(N):
	from math import sqrt
	n = N
	dissembly = {}
	search_maxval = sqrt(N) + 1
	i = 2
	while True:
		if N == 1 or i == search_maxval:
			if n == N:
				dissembly[N] = 1
			break

		if N % i == 0:
			if i in dissembly:
				dissembly[i] += 1
			else:
				dissembly[i] = 1

			N /= i

		else:
			i += 1

	return dissembly

m = factoring(N)

nim = 0
for val in m.values():
	nim ^= val

if nim == 0:
	print("Bob")
else:
	print("Alice")



0