結果

問題 No.564 背の順
コンテスト
ユーザー pypypymi
提出日時 2022-03-05 14:54:55
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 27 ms / 2,000 ms
コード長 351 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 146 ms
コンパイル使用メモリ 85,380 KB
実行使用メモリ 138,180 KB
最終ジャッジ日時 2026-04-02 18:05:51
合計ジャッジ時間 944 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

h,n = map(int,input().split())
array = [h] + [int(input()) for i in range(n-1)]
array_s = list(sorted(array))[::-1]
index = array_s.index(h)+1
result = int(str(index)[-1])
if result==1:
    print("{}st".format(index))
elif result==2:
    print("{}nd".format(index))
elif result==3:
    print("{}rd".format(index))
else:
    print("{}th".format(index))
0