結果

問題 No.564 背の順
ユーザー otsunekootsuneko
提出日時 2021-05-07 17:04:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 312 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,296 KB
実行使用メモリ 71,668 KB
最終ジャッジ日時 2023-10-13 08:15:06
合計ジャッジ時間 2,229 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,344 KB
testcase_01 AC 65 ms
71,464 KB
testcase_02 AC 69 ms
71,196 KB
testcase_03 AC 65 ms
71,388 KB
testcase_04 AC 65 ms
71,512 KB
testcase_05 AC 67 ms
71,440 KB
testcase_06 AC 67 ms
71,668 KB
testcase_07 AC 64 ms
71,464 KB
testcase_08 AC 67 ms
71,400 KB
testcase_09 AC 64 ms
71,440 KB
testcase_10 AC 66 ms
71,200 KB
testcase_11 AC 66 ms
71,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import bisect
H,N = map(int,input().split())
H_list = [int(input()) for _ in range(N-1)]
H_list.sort()
n = N - bisect.bisect(H_list,H)

ans = ""
if n%10 == 1:
    ans = str(n)+"st"
elif n%10 == 2:
    ans = str(n)+"nd"
elif n%10 == 3:
    ans = str(n)+"rd"
else:
    ans = str(n)+"th"

print(ans)
0