結果
| 問題 | No.275 中央値を求めよ |
| コンテスト | |
| ユーザー |
horiesiniti
|
| 提出日時 | 2016-05-25 19:19:22 |
| 言語 | Ruby (4.0.2) |
| 結果 |
AC
|
| 実行時間 | 50 ms / 1,000 ms |
| + 669µs | |
| コード長 | 188 bytes |
| 記録 | |
| コンパイル時間 | 9 ms |
| コンパイル使用メモリ | 8,704 KB |
| 実行使用メモリ | 14,592 KB |
| 最終ジャッジ日時 | 2026-07-29 11:33:58 |
| 合計ジャッジ時間 | 3,733 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 38 |
コンパイルメッセージ
Syntax OK
ソースコード
# your code goes here
n=STDIN.gets.to_i
as=STDIN.gets.split(" ")
as.size.times do |i|
as[i]=as[i].to_i
end
as=as.sort()
if n%2==1
puts as[n/2]
else
puts (as[n/2-1]+as[n/2])/2.0
end
horiesiniti