結果

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

ソースコード

diff #

def order(n)
  case n
  when 1; "1st"
  when 2; "2nd"
  when 3; "3rd"
  else; "#{n}th"
  end
end

H, N = gets.split.map(&:to_i)
S = Array.new(N + 1, H)
(1 .. N).each{|i|S[i] = gets.to_i}
S.sort!.reverse!
puts order(S.index(H) + 1)
0