結果

問題 No.715 集合と二人ゲーム
ユーザー claw88claw88
提出日時 2018-07-14 02:45:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 308 ms / 2,000 ms
コード長 2,637 bytes
コンパイル時間 1,139 ms
コンパイル使用メモリ 114,028 KB
実行使用メモリ 59,768 KB
最終ジャッジ日時 2024-04-17 11:52:22
合計ジャッジ時間 8,115 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
18,048 KB
testcase_01 AC 33 ms
18,816 KB
testcase_02 AC 34 ms
18,944 KB
testcase_03 AC 36 ms
19,200 KB
testcase_04 AC 37 ms
19,712 KB
testcase_05 AC 38 ms
20,224 KB
testcase_06 AC 39 ms
20,224 KB
testcase_07 AC 40 ms
20,336 KB
testcase_08 AC 43 ms
20,472 KB
testcase_09 AC 44 ms
20,992 KB
testcase_10 AC 43 ms
21,120 KB
testcase_11 AC 46 ms
21,504 KB
testcase_12 AC 47 ms
21,332 KB
testcase_13 AC 50 ms
21,736 KB
testcase_14 AC 53 ms
22,188 KB
testcase_15 AC 52 ms
21,860 KB
testcase_16 AC 54 ms
22,396 KB
testcase_17 AC 53 ms
22,120 KB
testcase_18 AC 57 ms
23,424 KB
testcase_19 AC 56 ms
23,296 KB
testcase_20 AC 60 ms
23,592 KB
testcase_21 AC 62 ms
24,008 KB
testcase_22 AC 64 ms
23,424 KB
testcase_23 AC 63 ms
23,296 KB
testcase_24 AC 66 ms
24,576 KB
testcase_25 AC 67 ms
24,576 KB
testcase_26 AC 67 ms
24,704 KB
testcase_27 AC 73 ms
25,472 KB
testcase_28 AC 72 ms
25,344 KB
testcase_29 AC 72 ms
25,600 KB
testcase_30 AC 67 ms
24,960 KB
testcase_31 AC 62 ms
23,552 KB
testcase_32 AC 59 ms
23,956 KB
testcase_33 AC 66 ms
24,448 KB
testcase_34 AC 60 ms
23,888 KB
testcase_35 AC 27 ms
18,176 KB
testcase_36 AC 27 ms
17,920 KB
testcase_37 AC 26 ms
18,048 KB
testcase_38 AC 26 ms
18,048 KB
testcase_39 AC 27 ms
18,048 KB
testcase_40 AC 32 ms
18,560 KB
testcase_41 AC 32 ms
18,432 KB
testcase_42 AC 32 ms
18,560 KB
testcase_43 AC 32 ms
18,560 KB
testcase_44 AC 32 ms
18,304 KB
testcase_45 AC 32 ms
18,176 KB
testcase_46 AC 32 ms
18,688 KB
testcase_47 AC 31 ms
18,560 KB
testcase_48 AC 32 ms
18,432 KB
testcase_49 AC 31 ms
18,304 KB
testcase_50 AC 304 ms
59,768 KB
testcase_51 AC 305 ms
59,720 KB
testcase_52 AC 305 ms
59,312 KB
testcase_53 AC 301 ms
58,812 KB
testcase_54 AC 305 ms
58,880 KB
testcase_55 AC 302 ms
59,372 KB
testcase_56 AC 290 ms
57,332 KB
testcase_57 AC 277 ms
57,516 KB
testcase_58 AC 308 ms
59,528 KB
testcase_59 AC 308 ms
59,620 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 System.Linq;
using System.IO;
//using System.Text;
//using System.Text.RegularExpressions;
//using System.Globalization;
//using System.Diagnostics;
using static System.Console;
//using System.Numerics;
//using static System.Math;
//using pair = Pair<int, int>;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 }; //→↓←↑
    readonly int mod = 1000000007;
    void chmax<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? b : a; }
    void chmin<T>(ref T a, T b) where T : IComparable<T> { a = a.CompareTo(b) < 0 ? a : b; }

   
    void solve()
    {
        int N = cin.nextint;
        var A = cin.scanint;
        Array.Sort(A);
        var memo = new[] { 0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 0, 5, 2, 2, 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 2, 7, 4, 0, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 2 };
        var roop = new[] { 3, 3, 0, 1, 1, 3, 0, 2, 1, 1, 0, 4, 5, 3, 7, 4, 8, 1, 1, 2, 0, 3, 1, 1, 0, 3, 3, 2, 2, 4, 4, 5, 5, 9 };

        int G = 0;
        int l = 0;
        for (int i = 1; i <= A.Length; i++)
        {
            if (i == A.Length || A[i] - A[i - 1] > 1)
            {
                int r = -1;
                int x = i - l;
                if (x < 52) r = memo[x];
                else r = roop[(x - 52) % 34];
                G ^= r;
                l = i;
            }
        }
        if (G == 0) WriteLine("Second");
        else WriteLine("First");
    }


}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}
0