結果

問題 No.564 背の順
ユーザー YU Hirose
提出日時 2024-07-09 13:55:56
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 32 ms / 2,000 ms
コード長 277 bytes
コンパイル時間 369 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-07-09 13:55:58
合計ジャッジ時間 1,953 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

h, n = map(int, input().split())
d = [int(input()) for _ in range(n-1)]
d.append(h)
d.sort(reverse=True)
r = d.index(h)+1
if str(r)[-1] == "1":
    print(f"{r}st")
elif str(r)[-1] == "2":
    print(f"{r}nd")
elif str(r)[-1] == "3":
    print(f"{r}rd")
else:
    print(f"{r}th")
0