結果

問題 No.564 背の順
ユーザー Toshihiko Yanase
提出日時 2018-05-01 13:28:28
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 453 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 60,408 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 00:07:47
合計ジャッジ時間 1,013 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


int main() {
  std::cin.tie(0);
  std::ios::sync_with_stdio(false);

  int H, N;
  cin >> H >> N;
  int ans = 1;
  for(int i=0;i<N-1;i++){
    int a;
    cin >> a;
    if(H < a) ans++;
  }

  string suffix = "th";
  int d = ans % 10;
  if(d==1) suffix = "st";
  else if(d==2) suffix = "nd";
  else if(d==3) suffix = "rd";
  cout << ans << suffix << endl;

  return 0;
}
0