結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
もちふわゆるゆる
|
| 提出日時 | 2023-04-14 17:23:47 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 42 ms / 5,000 ms |
| コード長 | 504 bytes |
| コンパイル時間 | 166 ms |
| コンパイル使用メモリ | 82,556 KB |
| 実行使用メモリ | 59,240 KB |
| 最終ジャッジ日時 | 2024-10-10 08:33:01 |
| 合計ジャッジ時間 | 2,421 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
import sys, math
input = lambda: sys.stdin.readline()[:-1]
def MI(): return map(int, input().split())
inf = 10**18
n, = MI()
# 素因数分解√n
def prime_fac(n):
res = []
x = n
y = 2
while y*y <= x:
ex = 0
while x % y == 0:
ex += 1
x //= y
if ex > 0: res.append((y, ex))
y += 1
if x > 1: res.append((x, 1))
return res
n_prime = prime_fac(n)
ans = 0
for i, c in n_prime:
ans ^= c
print('Alice' if ans!=0 else 'Bob')
もちふわゆるゆる