結果
| 問題 |
No.2 素因数ゲーム
|
| コンテスト | |
| ユーザー |
KoshStorm
|
| 提出日時 | 2018-03-12 12:25:54 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 465 bytes |
| コンパイル時間 | 276 ms |
| コンパイル使用メモリ | 12,672 KB |
| 実行使用メモリ | 16,000 KB |
| 最終ジャッジ日時 | 2024-11-07 11:56:53 |
| 合計ジャッジ時間 | 8,475 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 19 TLE * 1 -- * 11 |
ソースコード
N = int(input())
def factoring(N):
from math import sqrt
n = N
dissembly = {}
search_maxval = sqrt(N) + 1
i = 2
while True:
if N == 1 or i == search_maxval:
if n == N:
dissembly[N] = 1
break
if N % i == 0:
if i in dissembly:
dissembly[i] += 1
else:
dissembly[i] = 1
N /= i
else:
i += 1
return dissembly
m = factoring(N)
nim = 0
for val in m.values():
nim ^= val
if nim == 0:
print("Bob")
else:
print("Alice")
KoshStorm