結果

問題 No.1716 Bonus Nim
ユーザー wolgnikwolgnik
提出日時 2021-10-22 23:35:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 338 bytes
コンパイル時間 140 ms
コンパイル使用メモリ 81,724 KB
実行使用メモリ 127,280 KB
最終ジャッジ日時 2023-10-24 15:47:45
合計ジャッジ時間 4,182 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,464 KB
testcase_01 AC 36 ms
53,464 KB
testcase_02 AC 33 ms
53,464 KB
testcase_03 AC 33 ms
53,464 KB
testcase_04 AC 122 ms
109,928 KB
testcase_05 AC 131 ms
114,812 KB
testcase_06 AC 124 ms
110,564 KB
testcase_07 AC 123 ms
104,888 KB
testcase_08 AC 123 ms
109,508 KB
testcase_09 AC 128 ms
107,344 KB
testcase_10 AC 121 ms
108,952 KB
testcase_11 AC 131 ms
107,356 KB
testcase_12 AC 122 ms
106,836 KB
testcase_13 AC 142 ms
127,280 KB
testcase_14 AC 130 ms
119,344 KB
testcase_15 AC 169 ms
76,636 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
    if nim == 0:
      print("Bob")
      continue
    nim = 0
    for x in a: nim ^= x
    if nim: print("Alice")
    else: print("Bob")
0