#include using namespace std; int main() { // 1. 入力情報取得. int H, N; cin >> H >> N; // 2. なま君の身長がクラスで高い順に何番目か? vector v; v.push_back(H); for(int i = 0; i < N - 1; i++){ int h; cin >> h; v.push_back(h); } sort(v.begin(), v.end()); // for(auto &p : v) cout << p << endl; // 3. 後処理. auto iter = lower_bound(v.begin(), v.end(), H); int index = v.end() - iter; string ans = ""; int r = index % 10; if(r == 1) ans = to_string(index) + "st"; if(r == 2) ans = to_string(index) + "nd"; if(r == 3) ans = to_string(index) + "rd"; if(r == 0 || r > 3) ans = to_string(index) + "th"; cout << ans << endl; return 0; }