結果

問題 No.564 背の順
ユーザー object1234object1234
提出日時 2019-02-22 23:38:31
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 259 bytes
コンパイル時間 63 ms
コンパイル使用メモリ 11,544 KB
実行使用メモリ 15,352 KB
最終ジャッジ日時 2023-08-17 07:09:23
合計ジャッジ時間 1,760 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 85 ms
15,288 KB
testcase_01 AC 83 ms
15,096 KB
testcase_02 AC 78 ms
15,300 KB
testcase_03 WA -
testcase_04 AC 78 ms
15,336 KB
testcase_05 AC 78 ms
15,328 KB
testcase_06 AC 77 ms
15,092 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 78 ms
15,352 KB
testcase_10 AC 79 ms
15,148 KB
testcase_11 AC 78 ms
15,112 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

s,n = gets.chomp.split(" ").map(&:to_i)
a = []
a << s
(n - 1).times { a << gets.chomp.to_i}
a = a.sort.reverse
z = a.index(s) + 1
case z
when 1
    suffix = "st"
when 2
    suffix = "nd"
when 3
    suffix = "rd"
else
    suffix = "th"
end
puts "#{z}#{suffix}"
0