結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
![]() |
提出日時 | 2024-10-21 22:25:31 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 5,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 391 ms |
コンパイル使用メモリ | 82,168 KB |
実行使用メモリ | 61,220 KB |
最終ジャッジ日時 | 2024-10-21 22:25:34 |
合計ジャッジ時間 | 2,912 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
import collectionsdef prime_factorize(n):a = []while n % 2 == 0:a.append(2)n //= 2f = 3while f * f <= n:if n % f == 0:a.append(f)n //= felse:f += 2if n != 1:a.append(n)return adef n_fact(N):c = collections.Counter(prime_factorize(N))return cN = int(input())M = list(map(int, input().split()))X = 0for m in M:for v in n_fact(m).values():X ^= v % 3if X == 0:print("Bob")else:print("Alice")