結果
問題 | No.275 中央値を求めよ |
ユーザー |
|
提出日時 | 2019-01-11 12:11:52 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 156 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 7,424 KB |
実行使用メモリ | 12,160 KB |
最終ジャッジ日時 | 2024-11-27 18:39:24 |
合計ジャッジ時間 | 4,752 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | AC * 8 WA * 30 |
コンパイルメッセージ
Main.rb:8: warning: `elsif' at the end of line without an expression Syntax OK
ソースコード
num = gets.to_i arr = gets.split.map(&:to_i).sort if num % 2 == 1 middle = (arr[(num/2)-1]+arr[num/2])/2 puts middle elsif puts arr[num/2] end