結果
| 問題 | 
                            No.3258 Xor Division Game
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-09-05 18:46:22 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 644 bytes | 
| コンパイル時間 | 364 ms | 
| コンパイル使用メモリ | 82,228 KB | 
| 実行使用メモリ | 328,812 KB | 
| 最終ジャッジ日時 | 2025-09-05 21:17:11 | 
| 合計ジャッジ時間 | 4,977 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | TLE * 1 -- * 66 | 
ソースコード
from collections import defaultdict
from random import randint
n = int(input())
f = list(map(int, input().split()))
f.append(0)
idx = set(range(n))
turn = 0
while idx:
    i = idx.pop()
    if f[i] == 0: continue
    l ,r = i, i+1
    while f[l-1] != 0: l -= 1
    while f[r] != 0: r += 1
    
    cnt = defaultdict(int)
    for j in range(l, r):
        cnt[f[j]] += 1
    
    for c, v in cnt.items():
        if v == 1:
            break
    else:
        continue
    
    for j in range(l, r):
        if f[j] == c:
            break
    
    idx.add(i)
    f[j] = 0
    idx.discard(j)
    turn ^= 1
print("Alice" if turn else "Bob")