結果

問題 No.2619 Sorted Nim
ユーザー heno239heno239
提出日時 2024-02-02 16:43:56
言語 C#
(.NET 8.0.203)
結果
AC  
実行時間 141 ms / 2,000 ms
コード長 778 bytes
コンパイル時間 13,185 ms
コンパイル使用メモリ 158,712 KB
実行使用メモリ 200,908 KB
最終ジャッジ日時 2024-02-02 16:44:23
合計ジャッジ時間 25,770 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
32,548 KB
testcase_01 AC 100 ms
32,548 KB
testcase_02 AC 119 ms
52,528 KB
testcase_03 AC 115 ms
55,652 KB
testcase_04 AC 110 ms
52,820 KB
testcase_05 AC 110 ms
52,704 KB
testcase_06 AC 123 ms
57,252 KB
testcase_07 AC 111 ms
52,512 KB
testcase_08 AC 118 ms
56,132 KB
testcase_09 AC 75 ms
32,548 KB
testcase_10 AC 140 ms
55,672 KB
testcase_11 AC 133 ms
53,936 KB
testcase_12 AC 115 ms
55,336 KB
testcase_13 AC 74 ms
32,676 KB
testcase_14 AC 119 ms
55,672 KB
testcase_15 AC 141 ms
53,936 KB
testcase_16 AC 118 ms
56,148 KB
testcase_17 AC 120 ms
56,932 KB
testcase_18 AC 122 ms
55,992 KB
testcase_19 AC 112 ms
52,352 KB
testcase_20 AC 114 ms
52,368 KB
testcase_21 AC 122 ms
57,396 KB
testcase_22 AC 112 ms
53,504 KB
testcase_23 AC 118 ms
55,340 KB
testcase_24 AC 118 ms
56,444 KB
testcase_25 AC 117 ms
56,284 KB
testcase_26 AC 114 ms
54,556 KB
testcase_27 AC 110 ms
52,512 KB
testcase_28 AC 120 ms
57,376 KB
testcase_29 AC 118 ms
56,452 KB
testcase_30 AC 114 ms
54,716 KB
testcase_31 AC 74 ms
32,676 KB
testcase_32 AC 109 ms
52,880 KB
testcase_33 AC 113 ms
54,088 KB
testcase_34 AC 110 ms
52,820 KB
testcase_35 AC 113 ms
54,700 KB
testcase_36 AC 117 ms
55,664 KB
testcase_37 AC 74 ms
32,676 KB
testcase_38 AC 111 ms
52,976 KB
testcase_39 AC 116 ms
55,972 KB
testcase_40 AC 111 ms
53,628 KB
testcase_41 AC 112 ms
53,756 KB
testcase_42 AC 109 ms
52,348 KB
testcase_43 AC 116 ms
55,976 KB
testcase_44 AC 117 ms
55,176 KB
testcase_45 AC 119 ms
55,968 KB
testcase_46 AC 114 ms
54,552 KB
testcase_47 AC 110 ms
52,528 KB
testcase_48 AC 74 ms
32,676 KB
testcase_49 AC 112 ms
53,928 KB
testcase_50 AC 110 ms
52,528 KB
testcase_51 AC 114 ms
54,072 KB
testcase_52 AC 75 ms
32,676 KB
testcase_53 AC 121 ms
57,532 KB
testcase_54 AC 113 ms
53,456 KB
testcase_55 AC 118 ms
56,912 KB
testcase_56 AC 113 ms
54,084 KB
testcase_57 AC 118 ms
56,496 KB
testcase_58 AC 118 ms
56,424 KB
testcase_59 AC 113 ms
54,072 KB
testcase_60 AC 111 ms
52,976 KB
testcase_61 AC 112 ms
200,908 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
  復元対象のプロジェクトを決定しています...
  /home/judge/data/code/main.csproj を復元しました (103 ms)。
MSBuild のバージョン 17.7.3+8ec440e68 (.NET)
  main -> /home/judge/data/code/bin/Release/net7.0/main.dll
  main -> /home/judge/data/code/bin/Release/net7.0/publish/

ソースコード

diff #

// See https://aka.ms/new-console-template for more information
using System.Collections;
using System.Runtime.InteropServices;

internal class Program
{
    public static void Main(string[] args)
    {
        int n = int.Parse(Console.ReadLine());
        int[] a = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        ArrayList ds = new ArrayList();
        ds.Add(a[0]);
        for (int i = 1; i < n; i++)
        {
            ds.Add(a[i] - a[i - 1]);
        }
        ds.Reverse();
        int x = 0;
        for (int i = 0; i < ds.Count; i += 2)
        {
            x ^= (int)ds[i];
        }

        if (x>0)
        {
            Console.WriteLine("First");
        }
        else
        {
            Console.WriteLine("Second");
        }
    }
}
0