結果

問題 No.564 背の順
コンテスト
ユーザー ABKZ
提出日時 2021-07-11 21:28:10
言語 PyPy3
(7.3.17)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 24 ms / 2,000 ms
コード長 308 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 338 ms
コンパイル使用メモリ 85,748 KB
実行使用メモリ 52,352 KB
最終ジャッジ日時 2026-03-23 06:55:12
合計ジャッジ時間 1,342 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

H, N = map(int, input().split())
Hi = [int(input()) for _ in range(N-1)]

rank = 1
for x in Hi:
    if x > H:
        rank += 1

if rank % 10 == 1:
    print(str(rank) + "st")
elif rank % 10 == 2:
    print(str(rank) + "nd")
elif rank % 10 == 3:
    print(str(rank) + "rd")
else:
    print(str(rank) + "th")
0