結果

問題 No.564 背の順
ユーザー Nisshy_24Nisshy_24
提出日時 2018-04-22 13:29:31
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 469 bytes
コンパイル時間 101 ms
コンパイル使用メモリ 10,764 KB
実行使用メモリ 8,008 KB
最終ジャッジ日時 2023-09-09 12:33:09
合計ジャッジ時間 959 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 16 ms
7,792 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
7,812 KB
testcase_06 AC 15 ms
7,904 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 15 ms
7,816 KB
testcase_10 AC 15 ms
7,956 KB
testcase_11 AC 16 ms
7,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

a,n = list(map(int, input().split()))
heights = []
for i in range(n):
    if i == n - 1:
        heights.append(0)
    else:
        heights.append(int(input()))
sorted(heights, reverse=True)
for i in range(len(heights)):
    if heights[i] < a:
        heights[i] = a
        if i == 0:
            print("1st")
        elif i == 1:
            print("2nd")
        elif i == 2:
            print("3rd")
        else:
            print(str(i + 1) + "th")
        break
0