結果

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

ソースコード

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'
elif 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