結果

問題 No.564 背の順
ユーザー ninoinui
提出日時 2020-01-14 09:12:48
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 274 bytes
コンパイル時間 1,551 ms
コンパイル使用メモリ 165,124 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-12-24 07:02:21
合計ジャッジ時間 2,114 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int H, N;
  cin >> H >> N;

  int ans = 1;
  for (int i = 0, h; i < N - 1 && cin >> h; i++) if (h > H) ans++;
  cout << ans;
  cout << ((ans == 1) ? "st" : (ans == 2) ? "nd" : (ans == 3) ? "rd" : "th") << "\n";
}
0