結果

問題 No.564 背の順
ユーザー netyo715
提出日時 2021-06-28 11:07:48
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 2,000 ms
コード長 387 bytes
コンパイル時間 251 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-06-25 12:05:28
合計ジャッジ時間 1,197 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

H, N = map(int, input().split())
Hs = [H] + [int(input()) for _ in range(N-1)]
hi = [(h, i) for i, h in enumerate(Hs)]
hi.sort(reverse=True)
for i in range(1, N+1):
    if hi[i-1][1] == 0:
        print(i, end="")
        if i%10==1:
            print("st")
        elif i%10==2:
            print("nd")
        elif i%10==3:
            print("rd")
        else:
            print("th")
0