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