結果

問題 No.564 背の順
ユーザー wonda_t_coffeewonda_t_coffee
提出日時 2020-01-29 23:06:14
言語 Ruby
(3.3.0)
結果
WA  
実行時間 -
コード長 240 bytes
コンパイル時間 420 ms
コンパイル使用メモリ 11,372 KB
実行使用メモリ 15,412 KB
最終ジャッジ日時 2023-10-14 07:56:44
合計ジャッジ時間 1,913 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

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