結果

問題 No.2044 Infinite Nim
ユーザー 👑 kakel-sankakel-san
提出日時 2022-08-19 22:18:06
言語 C#(csc)
(csc 3.9.0)
結果
RE  
実行時間 -
コード長 836 bytes
コンパイル時間 1,487 ms
コンパイル使用メモリ 107,264 KB
実行使用メモリ 33,536 KB
最終ジャッジ日時 2024-04-17 00:59:01
合計ジャッジ時間 4,454 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
18,816 KB
testcase_01 AC 30 ms
19,072 KB
testcase_02 AC 30 ms
18,944 KB
testcase_03 AC 29 ms
18,816 KB
testcase_04 AC 30 ms
18,944 KB
testcase_05 AC 29 ms
19,072 KB
testcase_06 RE -
testcase_07 AC 30 ms
19,072 KB
testcase_08 AC 30 ms
18,944 KB
testcase_09 AC 30 ms
18,944 KB
testcase_10 RE -
testcase_11 AC 29 ms
19,072 KB
testcase_12 AC 31 ms
18,688 KB
testcase_13 AC 56 ms
23,216 KB
testcase_14 AC 48 ms
21,760 KB
testcase_15 AC 45 ms
21,336 KB
testcase_16 AC 46 ms
21,888 KB
testcase_17 AC 62 ms
24,448 KB
testcase_18 AC 43 ms
21,248 KB
testcase_19 AC 44 ms
21,404 KB
testcase_20 AC 55 ms
23,104 KB
testcase_21 AC 67 ms
25,472 KB
testcase_22 AC 54 ms
23,224 KB
testcase_23 AC 47 ms
22,528 KB
testcase_24 AC 61 ms
24,192 KB
testcase_25 AC 50 ms
22,620 KB
testcase_26 AC 61 ms
24,192 KB
testcase_27 AC 46 ms
21,604 KB
testcase_28 AC 70 ms
26,240 KB
testcase_29 AC 53 ms
23,552 KB
testcase_30 AC 60 ms
24,212 KB
testcase_31 AC 75 ms
27,392 KB
testcase_32 AC 76 ms
27,392 KB
testcase_33 AC 77 ms
27,392 KB
testcase_34 RE -
testcase_35 AC 89 ms
33,536 KB
testcase_36 AC 29 ms
19,072 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 static System.Console;
using System.Linq;
using System.Collections.Generic;

class Program
{
    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 n = NN;
        var a = NList;
        var infcnt = 0;
        foreach (var ai in a) if (ai == -1) ++infcnt;
        if (infcnt > 0)
        {
            var xor = a.Where(ai => ai >= 0).Aggregate((l, r) => l ^ r);
            WriteLine((xor == 0 && infcnt % 2 == 0) ? "Second" : "First");
        }
        else
        {
            var xor = a.Aggregate((l, r) => l ^ r);
            WriteLine(xor == 0 ? "Second" : "First");
        }
    }
}
0