結果
| 問題 | No.564 背の順 | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-08-31 20:43:14 | 
| 言語 | PyPy3 (7.3.15) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 55 ms / 2,000 ms | 
| コード長 | 401 bytes | 
| コンパイル時間 | 451 ms | 
| コンパイル使用メモリ | 82,324 KB | 
| 実行使用メモリ | 63,900 KB | 
| 最終ジャッジ日時 | 2024-08-31 20:43:16 | 
| 合計ジャッジ時間 | 1,472 ms | 
| ジャッジサーバーID (参考情報) | judge4 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 | 
ソースコード
from collections import *
from functools import *
from heapq import *
from itertools import *
import sys, math,random
h,n = map(int,input().split())
H = [int(input()) for _ in range(n-1)]
H += [h]
H.sort(reverse=True)
suffix = defaultdict(lambda:'th')
suffix[1] = 'st'
suffix[2] = 'nd'
suffix[3] = 'rd'
for i,_h in enumerate(H):
    if _h==h:
        print(f"{i+1}{suffix[(i+1)%10]}")
        exit()
            
            
            
        