fork download
  1. import sys
  2. input = sys.stdin.readline
  3.  
  4. T = int(input())
  5. for _ in range(T):
  6. n = int(input())
  7. A = list(map(int, input().split()))
  8. S = 0
  9. for x in A:
  10. S |= x
  11. ans = "Bob"
  12. for b in range(30, -1, -1):
  13. cnt = sum(((x >> b) & 1) for x in A)
  14. if cnt % 2 == 1:
  15. if cnt % 4 == 1:
  16. ans = "Bob"
  17. else:
  18. ans = "Alice"
  19. break
  20. print(ans)
Success #stdin #stdout 0.03s 9196KB
stdin
4
3
3 4 6
3
7 7 7
3
9 3 5
10
1 9 1 3 7 9 10 9 7 3
stdout
Bob
Alice
Bob
Bob