結果

問題 No.1716 Bonus Nim
ユーザー 👑 kakel-sankakel-san
提出日時 2021-10-22 23:09:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 353 ms / 2,000 ms
コード長 1,045 bytes
コンパイル時間 928 ms
コンパイル使用メモリ 111,252 KB
実行使用メモリ 58,948 KB
最終ジャッジ日時 2023-10-24 15:09:29
合計ジャッジ時間 8,261 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
25,632 KB
testcase_01 AC 30 ms
25,636 KB
testcase_02 AC 30 ms
25,628 KB
testcase_03 AC 28 ms
25,504 KB
testcase_04 AC 286 ms
52,780 KB
testcase_05 AC 267 ms
56,116 KB
testcase_06 AC 251 ms
48,668 KB
testcase_07 AC 295 ms
52,352 KB
testcase_08 AC 293 ms
52,728 KB
testcase_09 AC 265 ms
52,200 KB
testcase_10 AC 347 ms
57,828 KB
testcase_11 AC 334 ms
51,968 KB
testcase_12 AC 335 ms
49,304 KB
testcase_13 AC 317 ms
58,948 KB
testcase_14 AC 353 ms
51,092 KB
testcase_15 AC 254 ms
33,460 KB
testcase_16 AC 30 ms
25,632 KB
testcase_17 AC 30 ms
25,640 KB
testcase_18 AC 30 ms
25,636 KB
testcase_19 AC 30 ms
25,640 KB
testcase_20 AC 31 ms
25,656 KB
testcase_21 AC 31 ms
25,648 KB
testcase_22 AC 337 ms
58,488 KB
testcase_23 AC 259 ms
54,156 KB
testcase_24 AC 317 ms
57,260 KB
testcase_25 AC 308 ms
58,044 KB
testcase_26 AC 344 ms
51,080 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using static System.Console;
using System.Linq;

class yuki319
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static int[][] NArr(int n) => Enumerable.Repeat(0, n).Select(_ => NList).ToArray();
    static void Main()
    {
        var t = NN;
        var res = new bool[t];
        for (var u = 0; u < t; ++u)
        {
            var n = NN;
            var a = NList;
            var nim = a.Aggregate((l, r) => l ^ r);
            if (n % 2 == 1 || nim != 0)
            {
                res[u] = true;
                continue;
            }
            Array.Sort(a);
            for (var i = 0; i < a.Length; i += 2)
            {
                if (a[i] != a[i + 1])
                {
                    res[u] = true;
                    break;
                }
            }
        }
        WriteLine(string.Join("\n", res.Select(r => r ? "Alice" : "Bob")));
    }
}
0