結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2018-02-28 16:10:07 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
AC
|
実行時間 | 33 ms / 2,000 ms |
コード長 | 289 bytes |
コンパイル時間 | 313 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 10,752 KB |
最終ジャッジ日時 | 2024-12-21 12:39:16 |
合計ジャッジ時間 | 1,325 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
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}')