結果

問題 No.2 素因数ゲーム
ユーザー AAAR SalmonAAAR Salmon
提出日時 2021-05-22 00:32:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 308 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 82,764 KB
実行使用メモリ 61,248 KB
最終ジャッジ日時 2024-04-18 17:09:40
合計ジャッジ時間 2,468 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
56,108 KB
testcase_01 AC 41 ms
55,128 KB
testcase_02 AC 44 ms
54,912 KB
testcase_03 AC 39 ms
54,992 KB
testcase_04 AC 40 ms
55,812 KB
testcase_05 AC 41 ms
55,120 KB
testcase_06 AC 39 ms
55,140 KB
testcase_07 AC 39 ms
55,288 KB
testcase_08 AC 44 ms
60,488 KB
testcase_09 AC 38 ms
55,040 KB
testcase_10 AC 45 ms
55,048 KB
testcase_11 AC 42 ms
55,308 KB
testcase_12 AC 38 ms
55,328 KB
testcase_13 AC 39 ms
55,936 KB
testcase_14 AC 39 ms
56,000 KB
testcase_15 AC 41 ms
60,696 KB
testcase_16 AC 41 ms
60,940 KB
testcase_17 AC 38 ms
55,660 KB
testcase_18 AC 38 ms
54,980 KB
testcase_19 AC 42 ms
61,248 KB
testcase_20 AC 42 ms
61,248 KB
testcase_21 AC 42 ms
60,096 KB
testcase_22 AC 45 ms
60,172 KB
testcase_23 AC 40 ms
55,112 KB
testcase_24 AC 46 ms
60,772 KB
testcase_25 AC 41 ms
61,184 KB
testcase_26 AC 41 ms
56,036 KB
testcase_27 AC 42 ms
56,240 KB
testcase_28 AC 41 ms
55,420 KB
testcase_29 AC 50 ms
55,320 KB
testcase_30 AC 43 ms
60,572 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
from functools import reduce
from operator import xor

N = int(input())

pf = defaultdict(lambda: 0)
i = 2
while i * i <= N:
	if N % i == 0:
		while N % i == 0:
			pf[i] += 1
			N //= i
	i += 1
if N != 1:
	pf[N] += 1

print('Alice' if reduce(xor, pf.values()) else 'Bob')
0