結果

問題 No.564 背の順
ユーザー pypypymipypypymi
提出日時 2022-03-05 14:54:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 82 ms / 2,000 ms
コード長 351 bytes
コンパイル時間 354 ms
コンパイル使用メモリ 87,172 KB
実行使用メモリ 71,576 KB
最終ジャッジ日時 2023-09-27 02:06:40
合計ジャッジ時間 2,082 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,356 KB
testcase_01 AC 78 ms
71,568 KB
testcase_02 AC 78 ms
71,460 KB
testcase_03 AC 82 ms
71,176 KB
testcase_04 AC 77 ms
71,576 KB
testcase_05 AC 80 ms
71,460 KB
testcase_06 AC 78 ms
71,128 KB
testcase_07 AC 78 ms
71,264 KB
testcase_08 AC 81 ms
71,208 KB
testcase_09 AC 77 ms
71,460 KB
testcase_10 AC 79 ms
71,404 KB
testcase_11 AC 77 ms
71,260 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h,n = map(int,input().split())
array = [h] + [int(input()) for i in range(n-1)]
array_s = list(sorted(array))[::-1]
index = array_s.index(h)+1
result = int(str(index)[-1])
if result==1:
    print("{}st".format(index))
elif result==2:
    print("{}nd".format(index))
elif result==3:
    print("{}rd".format(index))
else:
    print("{}th".format(index))
0