結果

問題 No.564 背の順
ユーザー masaktmasakt
提出日時 2017-09-09 00:15:54
言語 Ruby
(3.3.0)
結果
AC  
実行時間 79 ms / 2,000 ms
コード長 147 bytes
コンパイル時間 151 ms
コンパイル使用メモリ 11,332 KB
実行使用メモリ 15,380 KB
最終ジャッジ日時 2023-08-07 08:48:23
合計ジャッジ時間 1,754 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
15,100 KB
testcase_01 AC 79 ms
15,380 KB
testcase_02 AC 76 ms
15,340 KB
testcase_03 AC 75 ms
15,204 KB
testcase_04 AC 76 ms
15,280 KB
testcase_05 AC 76 ms
15,152 KB
testcase_06 AC 76 ms
15,292 KB
testcase_07 AC 76 ms
15,276 KB
testcase_08 AC 75 ms
15,328 KB
testcase_09 AC 76 ms
15,172 KB
testcase_10 AC 76 ms
15,144 KB
testcase_11 AC 76 ms
15,148 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Syntax OK

ソースコード

diff #

h,n=gets.split.map &:to_i
a=[]
a<<h
~-n.times{a<<gets.to_i}
a.sort!.reverse!
t=a.index(h)+1
s=t%10
puts t.to_s+(s==1?"st":s==2?"nd":s==3?"rd":"th")
0