結果

問題 No.1716 Bonus Nim
ユーザー wolgnikwolgnik
提出日時 2021-10-22 23:40:30
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 1,205 ms
コンパイル使用メモリ 81,564 KB
実行使用メモリ 127,152 KB
最終ジャッジ日時 2023-10-24 15:53:29
合計ジャッジ時間 4,428 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,376 KB
testcase_01 AC 39 ms
53,376 KB
testcase_02 AC 36 ms
53,376 KB
testcase_03 AC 36 ms
53,376 KB
testcase_04 AC 127 ms
109,800 KB
testcase_05 AC 132 ms
114,708 KB
testcase_06 AC 127 ms
110,436 KB
testcase_07 AC 126 ms
104,768 KB
testcase_08 AC 126 ms
108,332 KB
testcase_09 AC 131 ms
107,228 KB
testcase_10 AC 123 ms
108,824 KB
testcase_11 AC 131 ms
107,216 KB
testcase_12 AC 124 ms
106,696 KB
testcase_13 AC 143 ms
127,152 KB
testcase_14 AC 135 ms
118,164 KB
testcase_15 AC 184 ms
76,464 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = sys.stdin.readline
for _ in range(int(input())):
  N = int(input())
  a = list(map(int, input().split()))
  if N & 1: print("Alice")
  else:
    nim = 0
    for x in a: nim ^= x - 1
    nim2 = 0
    for x in a: nim2 ^= x
    if nim & nim2: print("Alice")
    else: print("Bob")
0