結果
| 問題 | 
                            No.564 背の順
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2024-08-31 20:42:24 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 396 bytes | 
| コンパイル時間 | 309 ms | 
| コンパイル使用メモリ | 82,236 KB | 
| 実行使用メモリ | 63,568 KB | 
| 最終ジャッジ日時 | 2024-08-31 20:42:26 | 
| 合計ジャッジ時間 | 1,807 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge3 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 6 WA * 3 | 
ソースコード
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]}")
        exit()