結果

問題 No.564 背の順
ユーザー maspy
提出日時 2020-01-11 10:55:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 352 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-24 12:58:58
合計ジャッジ時間 1,072 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

x, N, *H = map(int,read().split())

rank = 1 + sum(h > x for h in H)
rank = str(rank)
if rank[-1] == '1':
    rank += 'st'
elif rank[-1] == '2':
    rank += 'nd'
elif rank[-1] == '3':
    rank += 'rd'
else:
    rank += 'th'
print(rank)
0