結果

問題 No.9005 実行時間/使用メモリテスト(テスト用)
ユーザー AreTrashAreTrash
提出日時 2018-10-12 10:16:26
言語 C#(csc)
(csc 3.9.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 957 bytes
コンパイル時間 795 ms
コンパイル使用メモリ 104,320 KB
実行使用メモリ 54,016 KB
最終ジャッジ日時 2024-04-20 19:50:23
合計ジャッジ時間 12,660 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 TLE -
testcase_02 TLE -
testcase_03 TLE -
testcase_04 TLE -
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

namespace No702
{
    public class Program
    {
        public static void Main(string[] args)
        {
            const int A = 9500001;
            var seed = uint.Parse(Console.ReadLine());
            var xorShift = new XorShift(seed);
            var list = new List<uint>(A + 10);

            for (var i = 0; i < A; i++)
            {
                var gen = xorShift.Generate();
                list.Add(gen);
            }

            list.Sort();
            Console.WriteLine(list[A / 2] - list[A / 2]);
        }
    }

    public class XorShift
    {
        uint x = 0, y = 1, z = 2, w = 3;

        public XorShift(uint seed)
        {
            x = seed;
        }

        public uint Generate()
        {
            var t = x ^ (x << 11);
            x = y;
            y = z;
            z = w;
            w = w ^ (w >> 19) ^ t ^ (t >> 8);
            return w;
        }
    }
}
0