結果

問題 No.564 背の順
コンテスト
ユーザー zbxah
提出日時 2018-02-28 16:10:07
言語 Python3
(3.15.0 + numpy 2.5.4 + scipy 1.18.1 + ACL)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 21 ms / 2,000 ms
+ 439µs
コード長 289 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 14,976 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2026-10-05 14:45:00
合計ジャッジ時間 1,506 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

H, N = [int(i) for i in input().split(' ')]
height_list = [H]
for _ in range(N - 1):
    height_list.append(int(input()))
height_list.sort(reverse=True)
rank = height_list.index(H) + 1
end = rank % 10
suffix = ['th', 'st', 'nd', 'rd', 'th'][end if end <= 3 else 4]
print(f'{rank}{suffix}')
0