結果

問題 No.564 背の順
ユーザー daku9640daku9640
提出日時 2018-03-19 00:14:33
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 272 bytes
コンパイル時間 725 ms
コンパイル使用メモリ 10,528 KB
実行使用メモリ 7,904 KB
最終ジャッジ日時 2023-08-28 20:56:44
合計ジャッジ時間 1,848 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,900 KB
testcase_01 AC 17 ms
7,764 KB
testcase_02 AC 15 ms
7,768 KB
testcase_03 AC 15 ms
7,764 KB
testcase_04 AC 15 ms
7,868 KB
testcase_05 AC 16 ms
7,844 KB
testcase_06 AC 16 ms
7,776 KB
testcase_07 AC 17 ms
7,784 KB
testcase_08 AC 16 ms
7,784 KB
testcase_09 AC 16 ms
7,840 KB
testcase_10 AC 16 ms
7,904 KB
testcase_11 AC 16 ms
7,840 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

h, n = map(int, input().split())
H = [h]
for _ in range(n - 1):
    H.append(int(input()))
ans = sorted(H)[::-1].index(h) + 1
print(ans, end="")
if ans % 10 == 1:
    print("st")
elif ans % 10 == 2:
    print("nd")
elif ans % 10 == 3:
    print("rd")
else:
    print("th")
0