結果

問題 No.564 背の順
ユーザー hir355
提出日時 2020-11-20 22:52:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 323 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 53,488 KB
最終ジャッジ日時 2024-07-23 13:34:16
合計ジャッジ時間 1,560 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

h, n = map(int, input().split())
a = sorted([int(input()) for _ in range(n - 1)] + [h], reverse=True)
res = a.index(h) + 1
if res % 10 == 1:
    print(str(res) + 'st')
elif res % 10 == 2:
    print(str(res) + 'nd')
elif res % 10 == 3:
    print(str(res) + 'rd')
else:
    print(str(res) + 'th')
0