結果
| 問題 | No.564 背の順 | 
| コンテスト | |
| ユーザー |  ei1333333 | 
| 提出日時 | 2017-09-08 22:22:05 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 2,000 ms | 
| コード長 | 356 bytes | 
| コンパイル時間 | 2,445 ms | 
| コンパイル使用メモリ | 192,216 KB | 
| 最終ジャッジ日時 | 2025-01-05 02:45:16 | 
| ジャッジサーバーID (参考情報) | judge5 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 9 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
  int H, N;
  cin >> H >> N;
  int rank = 1;
  for(int i = 0; i < N - 1; i++) {
    int x;
    cin >> x;
    if(H < x) ++rank;
  }
  cout << rank;
  if(rank % 10 == 1) cout << "st\n";
  else if(rank % 10 == 2) cout << "nd\n";
  else if(rank % 10 == 3) cout << "rd\n";
  else cout << "th\n";
}
            
            
            
        