結果

問題 No.564 背の順
ユーザー RyutoRyuto
提出日時 2018-02-27 22:19:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 84 ms / 2,000 ms
コード長 396 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 86,716 KB
実行使用メモリ 71,472 KB
最終ジャッジ日時 2023-08-20 10:19:01
合計ジャッジ時間 2,405 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,324 KB
testcase_01 AC 72 ms
71,168 KB
testcase_02 AC 73 ms
71,360 KB
testcase_03 AC 72 ms
71,240 KB
testcase_04 AC 81 ms
70,980 KB
testcase_05 AC 80 ms
71,436 KB
testcase_06 AC 78 ms
71,452 KB
testcase_07 AC 77 ms
70,960 KB
testcase_08 AC 78 ms
71,452 KB
testcase_09 AC 79 ms
71,248 KB
testcase_10 AC 84 ms
71,252 KB
testcase_11 AC 81 ms
71,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python

hn = [int(x) for x in input().split()]
hlist = [hn[0]]
for i in range(hn[1]-1):
    hlist.append(int(input()))

hlist.sort(reverse=True)
ind = hlist.index(hn[0]) + 1

if str(ind)[-1] == '1':
    print('{0}st'.format(ind))
elif str(ind)[-1] == '2':
    print('{0}nd'.format(ind))
elif str(ind)[-1] == '3':
    print('{0}rd'.format(ind))
else:
    print('{0}th'.format(ind))
0