結果

問題 No.564 背の順
ユーザー dragonlaunchdragonlaunch
提出日時 2017-11-12 03:08:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 453 bytes
コンパイル時間 930 ms
コンパイル使用メモリ 10,900 KB
実行使用メモリ 7,948 KB
最終ジャッジ日時 2023-08-16 08:09:54
合計ジャッジ時間 1,590 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

H,N = [int(i) for i in input().split()]
h = []
for i in range(N-1):
    h.append(int(input()))
h.sort()
#print(h)
high = len(h)
low = 0
while(high > low):
    mid = (low + high)//2
    if h[mid] >= H:
        high = mid
    if h[mid] < H:
        low = mid + 1
if (N-low) % 10 == 1:
    print(str(N-low)+'st')
if (N - low) % 10 == 2:
    print(str(N - low) + 'nd')
if (N - low) % 10 == 3:
    print(str(N - low) + 'rd')
else:
    print(str(N-low)+'th')
0