結果

問題 No.564 背の順
ユーザー wonda_t_coffee
提出日時 2020-01-29 23:06:14
言語 Ruby
(3.4.1)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 7,424 KB
実行使用メモリ 12,288 KB
最終ジャッジ日時 2024-09-16 03:04:29
合計ジャッジ時間 1,841 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h, n = gets.chomp.split.map(&:to_i)
a = [h]
(n-1).times do
  a << gets.chomp.to_i
end
a = a.sort.reverse

rank = a.index(h) + 1

if rank == 1
  puts "1st"
elsif rank == 2
  puts "2nd"
elsif rank == 3
  puts "3rd"
else
  puts "#{rank}th"
end
0