結果

問題 No.1716 Bonus Nim
ユーザー 👑 obakyanobakyan
提出日時 2022-03-29 20:26:56
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 362 ms / 2,000 ms
コード長 343 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 5,456 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-08-08 13:12:31
合計ジャッジ時間 10,079 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 342 ms
7,272 KB
testcase_05 AC 346 ms
7,264 KB
testcase_06 AC 342 ms
6,028 KB
testcase_07 AC 354 ms
8,056 KB
testcase_08 AC 350 ms
7,152 KB
testcase_09 AC 351 ms
7,440 KB
testcase_10 AC 347 ms
7,168 KB
testcase_11 AC 346 ms
6,624 KB
testcase_12 AC 345 ms
7,172 KB
testcase_13 AC 362 ms
7,520 KB
testcase_14 AC 347 ms
7,560 KB
testcase_15 AC 156 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,384 KB
testcase_22 AC 359 ms
8,680 KB
testcase_23 AC 352 ms
8,192 KB
testcase_24 AC 351 ms
7,812 KB
testcase_25 AC 358 ms
7,948 KB
testcase_26 AC 355 ms
8,696 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local q = io.read("*n")
for iq = 1, q do
  local n = io.read("*n")
  local a = {}
  for i = 1, n do
    a[i] = io.read("*n")
  end
  table.sort(a)
  if n % 2 == 1 then
    print("Alice")
  else
    local f = false
    for i = 1, n - 1, 2 do
      if a[i] ~= a[i + 1] then f = true break end
    end
    print(f and "Alice" or "Bob")
  end
end
0