結果

問題 No.564 背の順
ユーザー mbanmban
提出日時 2017-09-22 14:49:25
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 2,000 ms
コード長 379 bytes
コンパイル時間 473 ms
コンパイル使用メモリ 82,168 KB
実行使用メモリ 53,636 KB
最終ジャッジ日時 2024-04-25 22:49:07
合計ジャッジ時間 1,672 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,612 KB
testcase_01 AC 38 ms
53,196 KB
testcase_02 AC 38 ms
52,408 KB
testcase_03 AC 37 ms
52,484 KB
testcase_04 AC 37 ms
53,200 KB
testcase_05 AC 38 ms
53,492 KB
testcase_06 AC 38 ms
52,924 KB
testcase_07 AC 38 ms
53,248 KB
testcase_08 AC 38 ms
52,460 KB
testcase_09 AC 37 ms
53,636 KB
testcase_10 AC 36 ms
52,964 KB
testcase_11 AC 38 ms
52,788 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H,N=map(int,input().split())
h=[int(input()) for i in range(N-1)]
h.sort(reverse=True)
flag=False
#print(h)
for index,i in enumerate(h):
    if i <=H:
        ans=index+1
        flag=True
        break
        
if not flag:
    ans=N

if ans%10==1:
    suffix='st'
elif ans%10==2:
    suffix='nd'
elif ans%10==3:
    suffix='rd'
else:
    suffix='th'
print(str(ans)+suffix)
    
0