結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
53,404 KB
testcase_01 AC 38 ms
53,404 KB
testcase_02 AC 37 ms
53,404 KB
testcase_03 AC 37 ms
53,404 KB
testcase_04 AC 133 ms
109,820 KB
testcase_05 AC 136 ms
114,728 KB
testcase_06 WA -
testcase_07 AC 129 ms
104,796 KB
testcase_08 WA -
testcase_09 AC 135 ms
107,248 KB
testcase_10 WA -
testcase_11 AC 134 ms
107,236 KB
testcase_12 WA -
testcase_13 AC 146 ms
127,176 KB
testcase_14 AC 138 ms
118,184 KB
testcase_15 WA -
testcase_16 AC 36 ms
53,404 KB
testcase_17 AC 38 ms
53,404 KB
testcase_18 AC 37 ms
53,404 KB
testcase_19 WA -
testcase_20 AC 38 ms
53,404 KB
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 140 ms
117,600 KB
testcase_24 AC 132 ms
114,180 KB
testcase_25 AC 146 ms
126,556 KB
testcase_26 AC 139 ms
115,544 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