結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-04-24 10:11:35 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 632 bytes |
| 記録 | |
| コンパイル時間 | 98 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-04 09:02:05 |
| 合計ジャッジ時間 | 2,137 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 27 WA * 4 |
ソースコード
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)
cnt_one = 0
cnt_multi = 0
for key in d:
if d[key] > 1:
cnt_multi += 1
else:
cnt_one += 1
if cnt_one%2:
if cnt_multi == 0 or cnt_multi%2:
print("Alice")
else:
print("Bob")
else:
if cnt_multi%2:
print("Alice")
else:
print("Bob")