結果

問題 No.524 コインゲーム
ユーザー sekiya9311sekiya9311
提出日時 2017-06-03 15:29:53
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 1,000 ms
コード長 2,091 bytes
コンパイル時間 907 ms
コンパイル使用メモリ 115,248 KB
実行使用メモリ 26,424 KB
最終ジャッジ日時 2024-04-10 08:46:13
合計ジャッジ時間 2,883 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 25 ms
21,936 KB
testcase_01 AC 25 ms
24,136 KB
testcase_02 AC 26 ms
26,044 KB
testcase_03 AC 25 ms
23,984 KB
testcase_04 AC 26 ms
26,012 KB
testcase_05 AC 24 ms
24,260 KB
testcase_06 AC 25 ms
24,136 KB
testcase_07 AC 25 ms
21,936 KB
testcase_08 AC 25 ms
24,116 KB
testcase_09 AC 26 ms
26,012 KB
testcase_10 AC 26 ms
26,424 KB
testcase_11 AC 25 ms
24,088 KB
testcase_12 AC 26 ms
26,132 KB
testcase_13 AC 25 ms
25,884 KB
testcase_14 AC 26 ms
24,096 KB
testcase_15 AC 25 ms
23,980 KB
testcase_16 AC 26 ms
24,004 KB
testcase_17 AC 25 ms
22,192 KB
testcase_18 AC 25 ms
23,876 KB
testcase_19 AC 26 ms
24,256 KB
testcase_20 AC 26 ms
24,244 KB
testcase_21 AC 26 ms
24,000 KB
testcase_22 AC 25 ms
24,132 KB
testcase_23 AC 26 ms
23,980 KB
testcase_24 AC 25 ms
24,256 KB
testcase_25 AC 25 ms
26,000 KB
testcase_26 AC 25 ms
24,220 KB
testcase_27 AC 26 ms
26,272 KB
testcase_28 AC 26 ms
24,132 KB
testcase_29 AC 25 ms
24,000 KB
testcase_30 AC 25 ms
24,012 KB
testcase_31 AC 25 ms
23,960 KB
testcase_32 AC 26 ms
26,008 KB
testcase_33 AC 25 ms
26,176 KB
testcase_34 AC 26 ms
24,004 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.Text;
using System.Threading.Tasks;

namespace Competitive_Programming
{
    class MainClass
    {
        Scanner sc;
        StringBuilder res;
        const long MOD = (long)1e9 + 7;
        static void Main(string[] args)
        {
            new MainClass().solve();
        }
        
        void solve()
        {
            sc = new Scanner();
            res = new StringBuilder();

            long N = sc.NextLong();
            res.Append((N % 4 == 3 ? "X" : "O"));

            Console.WriteLine(res);
            res.Clear();
        }
        int[] grundy;
        int dfs(int now)
        {
            if (grundy[now] != -1)
            {
                return grundy[now];
            }
            HashSet<int> se = new HashSet<int>();
            for (int i = now - 1; i >= 0; i--)
            {
                se.Add(dfs(i));
            }
            int n = 0;
            while (se.Contains(n))
            {
                n++;
            }
            return grundy[now] = n;
        }
    }
    
    class Scanner
    {
        Queue<string> buf;
        public Scanner()
        {
            buf = new Queue<string>();
        }
        private void GetBuf()
        {
            while (buf.Count == 0)
            {
                string[] stringArray = Console.ReadLine().Split(' ');
                if (stringArray.Length == 0 || stringArray[0] == "")
                {
                    continue;
                }
                foreach (string e in stringArray)
                {
                    buf.Enqueue(e);
                }
            }
        }
        public int NextInt()
        {
            return int.Parse(this.Next());
        }
        public long NextLong()
        {
            return long.Parse(this.Next());
        }
        public double NextDouble()
        {
            return double.Parse(this.Next());
        }
        public string Next()
        {
            this.GetBuf();
            return buf.Dequeue();
        }
    }
}
0