結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-31 20:43:14 |
| 言語 | PyPy3 (7.3.23) |
| 結果 |
AC
|
| 実行時間 | 104 ms / 2,000 ms |
| + 563µs | |
| コード長 | 401 bytes |
| 記録 | |
| コンパイル時間 | 271 ms |
| コンパイル使用メモリ | 96,232 KB |
| 実行使用メモリ | 84,608 KB |
| 最終ジャッジ日時 | 2026-08-25 10:35:26 |
| 合計ジャッジ時間 | 2,674 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()