結果

問題 No.564 背の順
コンテスト
ユーザー pluto77
提出日時 2017-09-23 08:53:36
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 83 ms / 2,000 ms
コード長 337 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 124 ms
コンパイル使用メモリ 77,244 KB
最終ジャッジ日時 2025-12-04 00:39:12
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#yuki_564

h,n=map(int,raw_input().split())
l=[h]
for i in xrange(n-1):
 l.append(int(raw_input()))
l2=sorted(l,reverse=True)
idx=l2.index(h)+1
#if idx==11 or idx==12 or idx==13:
# print str(idx)+'th'
if idx%10==1:
 print str(idx)+'st'
elif idx%10==2:
 print str(idx)+'nd'
elif idx%10==3:
 print str(idx)+'rd'
else:
 print str(idx)+'th'
0