結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2017-12-31 13:11:27 |
言語 | Ruby (3.4.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 616 bytes |
コンパイル時間 | 273 ms |
コンパイル使用メモリ | 7,680 KB |
実行使用メモリ | 12,416 KB |
最終ジャッジ日時 | 2024-12-21 15:15:38 |
合計ジャッジ時間 | 2,519 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
nama = gets.split.map(&:to_i) heights = Array.new heights.push(1000) heights.push(nama[0]) nama[1].times do |i| heights[i + 1] = gets.to_i end heights = heights.sort.reverse if nama[0] == 1000 puts "1st" return end for i in 0...nama[1] if heights[i] > nama[0] && nama[0] > heights[i + 1] #puts "i : #{heights[i]} => #{nama[0]} =>#{heights[i + 1]}" case i when 0 puts "1st" when 1 puts "2nd" when 2 puts "3rd" else puts "#{i+1}th" end return end end