結果

問題 No.564 背の順
ユーザー hir355hir355
提出日時 2020-11-20 22:52:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 72 ms / 2,000 ms
コード長 295 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 86,604 KB
実行使用メモリ 71,172 KB
最終ジャッジ日時 2023-09-30 19:46:32
合計ジャッジ時間 2,017 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,124 KB
testcase_01 AC 70 ms
71,172 KB
testcase_02 AC 70 ms
71,088 KB
testcase_03 AC 69 ms
70,784 KB
testcase_04 AC 69 ms
71,096 KB
testcase_05 AC 70 ms
71,040 KB
testcase_06 AC 72 ms
70,780 KB
testcase_07 AC 70 ms
71,148 KB
testcase_08 AC 70 ms
70,776 KB
testcase_09 AC 71 ms
70,788 KB
testcase_10 AC 68 ms
71,096 KB
testcase_11 AC 70 ms
71,036 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, n = map(int, input().split())
a = sorted([int(input()) for _ in range(n - 1)] + [h], reverse=True)
res = a.index(h) + 1
if res % 10 == 1:
    print(str(res) + 'st')
elif res % 10 == 2:
    print(str(res) + 'nd')
elif res % 10 == 3:
    print(str(res) + 'rd')
else:
    print(str(res) + 'th')
0