結果
| 問題 |
No.2 素因数ゲーム
|
| コンテスト | |
| ユーザー |
rarpipipi
|
| 提出日時 | 2024-04-27 20:04:19 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 45 ms / 5,000 ms |
| コード長 | 485 bytes |
| コンパイル時間 | 302 ms |
| コンパイル使用メモリ | 82,204 KB |
| 実行使用メモリ | 60,064 KB |
| 最終ジャッジ日時 | 2024-11-16 01:17:24 |
| 合計ジャッジ時間 | 2,810 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
# 素因数分解のリストを返す
def prime_factorize(n):
a = []
while n % 2 == 0:
a.append(2)
n //= 2
f = 3
while f * f <= n:
if n % f == 0:
a.append(f)
n //= f
else:
f += 2
if n != 1:
a.append(n)
return a
n=int(input())
from collections import Counter
li=prime_factorize(n)
c=Counter(li)
xor=0
for x in c.values():
xor^=x
if xor:
print("Alice")
else:
print("Bob")
rarpipipi