結果

問題 No.2 素因数ゲーム
ユーザー otsunekootsuneko
提出日時 2021-04-24 13:19:46
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 45 ms / 5,000 ms
コード長 418 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 82,384 KB
実行使用メモリ 60,976 KB
最終ジャッジ日時 2024-07-04 09:04:45
合計ジャッジ時間 2,388 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter
def prime_decomposition(n):
  i = 2
  table = []
  while i * i <= n:
    while n % i == 0:
      n = n//i
      table.append(i)
    i += 1
  if n > 1:
    table.append(n)
  return table

N = int(input())
prime = prime_decomposition(N)
d = Counter()
d.update(prime)

xor = 0
for key in d:
    xor = xor ^ d[key]

if xor:
    print("Alice")
else:
    print("Bob")
0