結果

問題 No.702 中央値を求めよ LIMITED
ユーザー aru aru
提出日時 2020-11-23 22:55:25
言語 Go
(1.23.4)
結果
MLE  
実行時間 -
コード長 532 bytes
コンパイル時間 10,778 ms
コンパイル使用メモリ 218,952 KB
実行使用メモリ 41,204 KB
最終ジャッジ日時 2024-07-23 18:04:51
合計ジャッジ時間 79,044 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample MLE * 2
other MLE * 25
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"sort"
)

var x, y, z, w uint32 = 0, 1, 2, 3

func generate() uint32 {
	t := (x ^ (x << 11))
	x = y
	y = z
	z = w
	w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))
	return w
}

const size = 10000001

func main() {
	// this template is new version.
	// use getI(), getS(), getInts(), getF()
	var seed int
	fmt.Scanf("%d", &seed)
	x = uint32(seed)
	a := make([]uint32, size)
	for i := 0; i < size; i++ {
		a[i] = generate()
	}
	sort.Slice(a, func(i, j int) bool {
		return a[i] < a[j]
	})
	fmt.Println(a[size/2])
}
0