結果
| 問題 | No.2 素因数ゲーム |
| コンテスト | |
| ユーザー |
taisuke
|
| 提出日時 | 2023-02-18 19:51:50 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 96 ms / 5,000 ms |
| コード長 | 509 bytes |
| 記録 | |
| コンパイル時間 | 771 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 35,928 KB |
| 最終ジャッジ日時 | 2026-04-02 20:22:50 |
| 合計ジャッジ時間 | 4,427 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_1 |
| 純コード判定待ち |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 31 |
ソースコード
def prime_factor(n):
ret = []
nmax = int(n**0.5 + 1)
x = n
for i in range(2, nmax):
if x % i == 0:
cnt = 0
while x % i == 0:
cnt += 1
x //= i
ret.append([i, cnt])
if x != 1:
ret.append([x, 1])
if ret == []:
ret.append([n, 1])
return ret
n = int(input())
prime = prime_factor(n)
xor_sum = 0
for x in prime:
xor_sum ^= x[1]
if (xor_sum != 0):
print("Alice")
else:
print("Bob")
taisuke