結果
問題 | No.275 中央値を求めよ |
ユーザー |
![]() |
提出日時 | 2016-10-05 20:18:55 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 164 bytes |
コンパイル時間 | 107 ms |
コンパイル使用メモリ | 7,296 KB |
実行使用メモリ | 12,288 KB |
最終ジャッジ日時 | 2024-11-21 17:21:42 |
合計ジャッジ時間 | 4,764 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 28 WA * 10 |
コンパイルメッセージ
Main.rb:6: warning: `-' after local variable or literal is interpreted as binary operator Main.rb:6: warning: even though it seems like unary operator Syntax OK
ソースコード
n = gets.to_iary = gets.chomp.split.map(&:to_i)ary.sort!if n % 2 == 0a1 = n / 2a2 = a1 -1puts (ary[a1] + ary[a2]) / 2elseb = n / 2puts ary[b]end