結果

問題 No.564 背の順
ユーザー TANIGUCHI KousukeTANIGUCHI Kousuke
提出日時 2019-11-01 13:12:36
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 231 bytes
コンパイル時間 56 ms
コンパイル使用メモリ 11,436 KB
実行使用メモリ 15,284 KB
最終ジャッジ日時 2023-10-13 00:41:08
合計ジャッジ時間 2,095 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 86 ms
15,092 KB
testcase_01 AC 82 ms
15,148 KB
testcase_02 AC 85 ms
15,284 KB
testcase_03 WA -
testcase_04 AC 82 ms
15,264 KB
testcase_05 AC 82 ms
15,228 KB
testcase_06 AC 82 ms
15,208 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 81 ms
15,112 KB
testcase_10 AC 83 ms
15,112 KB
testcase_11 AC 84 ms
15,040 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
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