結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-08-31 20:42:24 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 396 bytes |
| 記録 | |
| コンパイル時間 | 182 ms |
| コンパイル使用メモリ | 85,632 KB |
| 実行使用メモリ | 62,464 KB |
| 最終ジャッジ日時 | 2026-04-03 23:56:59 |
| 合計ジャッジ時間 | 1,606 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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()