結果

問題 No.564 背の順
ユーザー rky
提出日時 2017-10-28 10:47:35
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 330 bytes
コンパイル時間 87 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-11-22 02:56:27
合計ジャッジ時間 1,694 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Main.rb:3: warning: assigned but unused variable - i
Syntax OK

ソースコード

diff #

height, test_case = gets.chomp.split().map(&:to_i)
height_list = Array.new
for i in 0...(test_case - 1) do
	height_list << gets.chomp.to_i
end

height_list << height
res = height_list.sort!{|a, b| b <=> a }.index(height) + 1
print res

if res == 1
	puts "st"
elsif res == 2
	puts "nd"
elsif res == 3
	puts "rd"
else
	puts "th"
end
0