結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2024-09-03 21:44:56 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 46 ms / 5,000 ms |
| コード長 | 392 bytes |
| 記録 | |
| コンパイル時間 | 285 ms |
| コンパイル使用メモリ | 82,196 KB |
| 実行使用メモリ | 60,852 KB |
| 最終ジャッジ日時 | 2024-09-03 21:44:59 |
| 合計ジャッジ時間 | 2,925 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
from collections import Counter
def factorize(n: int) -> list[int]:
res = []
p = 2
while p * p <= n:
while n % p == 0:
res.append(p)
n //= p
p += 1
if n > 1:
res.append(n)
return res
N = int(input())
ans = 0
for v in Counter(factorize(N)).values():
ans ^= v
if ans == 0:
print('Bob')
else:
print('Alice')
norioc