結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-11 05:06:15 |
| 言語 | Ruby (3.4.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 267 bytes |
| コンパイル時間 | 56 ms |
| コンパイル使用メモリ | 7,552 KB |
| 実行使用メモリ | 12,416 KB |
| 最終ジャッジ日時 | 2024-11-07 16:43:01 |
| 合計ジャッジ時間 | 1,817 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
コンパイルメッセージ
Syntax OK
ソースコード
h,n = gets.chomp.split.map(&:to_i)
rank = 1
(n - 1).times do
if gets.chomp.to_i > h
rank += 1
end
end
rank = rank.to_s
if rank == '1'
puts rank + 'st'
elsif rank == '2'
puts rank + 'nd'
elsif rank == '3'
puts rank + 'rd'
else
puts rank + 'th'
end