結果

問題 No.702 中央値を求めよ LIMITED
ユーザー letrangerjpletrangerjp
提出日時 2018-06-16 00:09:02
言語 Ruby
(3.3.0)
結果
AC  
実行時間 3,689 ms / 5,000 ms
コード長 346 bytes
コンパイル時間 406 ms
コンパイル使用メモリ 11,184 KB
実行使用メモリ 15,888 KB
最終ジャッジ日時 2023-08-14 21:17:38
合計ジャッジ時間 101,977 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3,393 ms
15,604 KB
testcase_01 AC 3,411 ms
15,676 KB
testcase_02 AC 3,457 ms
15,656 KB
testcase_03 AC 3,427 ms
15,756 KB
testcase_04 AC 3,586 ms
15,668 KB
testcase_05 AC 3,568 ms
15,816 KB
testcase_06 AC 3,503 ms
15,876 KB
testcase_07 AC 3,489 ms
15,608 KB
testcase_08 AC 3,531 ms
15,676 KB
testcase_09 AC 3,591 ms
15,648 KB
testcase_10 AC 3,664 ms
15,660 KB
testcase_11 AC 3,640 ms
15,824 KB
testcase_12 AC 3,631 ms
15,564 KB
testcase_13 AC 3,571 ms
15,672 KB
testcase_14 AC 3,649 ms
15,680 KB
testcase_15 AC 3,689 ms
15,668 KB
testcase_16 AC 3,641 ms
15,820 KB
testcase_17 AC 3,643 ms
15,880 KB
testcase_18 AC 3,544 ms
15,824 KB
testcase_19 AC 3,591 ms
15,668 KB
testcase_20 AC 3,619 ms
15,780 KB
testcase_21 AC 3,634 ms
15,888 KB
testcase_22 AC 3,610 ms
15,820 KB
testcase_23 AC 3,544 ms
15,648 KB
testcase_24 AC 3,537 ms
15,824 KB
testcase_25 AC 3,583 ms
15,568 KB
testcase_26 AC 3,597 ms
15,864 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

x = 0
y = 1
z = 2
w = 3
generate = ->{
  t = (x ^ (x << 11)) & 0xffffffff
  x, y, z = y, z, w
  w = (w ^ (w >> 19)) ^ (t ^ (t >> 8))
}

x = gets.to_i

min = 2143000000
max = 2153000000
low = high = 0
a = []
1000_0001.times{
  r = generate[]
  if r < min
    low += 1
  elsif r > max
    high += 1
  else
    a << r
  end
}
p a.sort[500_0000-low]
0