結果
問題 | No.103 素因数ゲーム リターンズ |
ユーザー |
|
提出日時 | 2023-06-27 19:48:39 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 30 ms / 5,000 ms |
コード長 | 493 bytes |
コンパイル時間 | 80 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-07-04 12:21:42 |
合計ジャッジ時間 | 1,595 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 5 |
other | AC * 20 |
ソースコード
def Prime(n):p = 2q = 0ans = []while p <= n**0.5:while n % p == 0:n //= pq += 1if q == 0:p += 1continueans.append([p,q])p += 1q = 0if n > 1:ans.append([n,1])return ansN = int(input())M = list(map(int,input().split()))G = []for i in range(N):m = M[i]pm = Prime(m)g = 0for p,q in pm:q %= 3g ^= qG.append(g)ans = 0for g in G:ans ^= gif ans != 0:print('Alice')else:print('Bob')