結果

問題 No.1716 Bonus Nim
ユーザー wolgnikwolgnik
提出日時 2021-10-22 23:39:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 296 bytes
コンパイル時間 342 ms
コンパイル使用メモリ 81,764 KB
実行使用メモリ 127,232 KB
最終ジャッジ日時 2023-10-24 15:52:37
合計ジャッジ時間 4,652 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,404 KB
testcase_01 AC 36 ms
53,404 KB
testcase_02 AC 37 ms
53,404 KB
testcase_03 AC 36 ms
53,404 KB
testcase_04 AC 126 ms
109,892 KB
testcase_05 AC 131 ms
114,792 KB
testcase_06 AC 122 ms
110,512 KB
testcase_07 AC 121 ms
104,844 KB
testcase_08 AC 122 ms
108,420 KB
testcase_09 AC 131 ms
107,304 KB
testcase_10 AC 121 ms
108,920 KB
testcase_11 AC 128 ms
107,316 KB
testcase_12 AC 122 ms
106,792 KB
testcase_13 AC 139 ms
127,232 KB
testcase_14 AC 134 ms
118,244 KB
testcase_15 AC 187 ms
76,508 KB
testcase_16 AC 36 ms
53,404 KB
testcase_17 AC 36 ms
53,404 KB
testcase_18 AC 36 ms
53,404 KB
testcase_19 WA -
testcase_20 AC 37 ms
53,404 KB
testcase_21 WA -
testcase_22 AC 133 ms
116,328 KB
testcase_23 AC 133 ms
117,656 KB
testcase_24 AC 124 ms
114,240 KB
testcase_25 AC 140 ms
126,616 KB
testcase_26 AC 134 ms
115,588 KB
権限があれば一括ダウンロードができます

ソースコード

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