結果
| 問題 | No.103 素因数ゲーム リターンズ |
| コンテスト | |
| ユーザー |
vwxyz
|
| 提出日時 | 2022-08-10 04:29:16 |
| 言語 | Python3 (3.14.7 + numpy 2.5.2 + scipy 1.18.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 93 ms / 5,000 ms |
| + 160µs | |
| コード長 | 501 bytes |
| 記録 | |
| コンパイル時間 | 290 ms |
| コンパイル使用メモリ | 21,336 KB |
| 実行使用メモリ | 15,792 KB |
| 最終ジャッジ日時 | 2026-08-31 17:08:40 |
| 合計ジャッジ時間 | 4,328 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 5 |
| other | AC * 20 |
ソースコード
from collections import defaultdict
import sys
readline=sys.stdin.readline
def Factorize(N):
assert N>=1
factors=defaultdict(int)
for p in range(2,N):
if p**2>N:
break
while N%p==0:
factors[p]+=1
N//=p
if N!=1:
factors[N]+=1
return factors
N=int(readline())
grundy=0
for M in map(int,readline().split()):
for p,e in Factorize(M).items():
grundy^=e%3
if grundy:
ans="Alice"
else:
ans="Bob"
print(ans)
vwxyz