結果

問題 No.1716 Bonus Nim
ユーザー wolgnikwolgnik
提出日時 2021-10-22 23:36:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 335 bytes
コンパイル時間 766 ms
コンパイル使用メモリ 81,568 KB
実行使用メモリ 131,184 KB
最終ジャッジ日時 2023-10-24 15:48:59
合計ジャッジ時間 4,252 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,328 KB
testcase_01 AC 34 ms
53,328 KB
testcase_02 AC 33 ms
53,328 KB
testcase_03 AC 34 ms
53,328 KB
testcase_04 AC 122 ms
109,684 KB
testcase_05 AC 128 ms
114,600 KB
testcase_06 AC 127 ms
110,752 KB
testcase_07 AC 127 ms
104,672 KB
testcase_08 AC 122 ms
109,276 KB
testcase_09 AC 128 ms
107,120 KB
testcase_10 AC 120 ms
108,716 KB
testcase_11 AC 127 ms
107,116 KB
testcase_12 AC 121 ms
106,600 KB
testcase_13 AC 141 ms
129,700 KB
testcase_14 AC 132 ms
118,068 KB
testcase_15 AC 173 ms
76,480 KB
testcase_16 AC 34 ms
53,368 KB
testcase_17 AC 34 ms
53,368 KB
testcase_18 AC 34 ms
53,368 KB
testcase_19 WA -
testcase_20 AC 33 ms
53,368 KB
testcase_21 WA -
testcase_22 AC 133 ms
118,692 KB
testcase_23 AC 132 ms
117,484 KB
testcase_24 AC 125 ms
114,208 KB
testcase_25 AC 140 ms
131,184 KB
testcase_26 AC 132 ms
116,412 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
    if nim:
      print("Alice")
      continue
    nim = 0
    for x in a: nim ^= x
    if nim: print("Alice")
    else: print("Bob")
0