結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2024-04-15 05:08:38 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 1,406 ms / 5,000 ms |
| コード長 | 418 bytes |
| 記録 | |
| コンパイル時間 | 988 ms |
| コンパイル使用メモリ | 82,432 KB |
| 実行使用メモリ | 82,684 KB |
| 最終ジャッジ日時 | 2024-10-04 17:12:47 |
| 合計ジャッジ時間 | 5,153 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
def factorize(n):
p = 2
while p * p <= n:
while n % p == 0:
yield p
n //= p
p += 1
if n > 1:
yield n
N = int(input())
ps = set(factorize(N))
def f(n: int) -> bool:
res = False
for p in ps:
x = n
while x % p == 0:
x //= p
res |= not f(x)
return res
if f(N):
print('Alice')
else:
print('Bob')
norioc