結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-09 15:56:30 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 373 bytes |
| 記録 | |
| コンパイル時間 | 2,005 ms |
| コンパイル使用メモリ | 193,408 KB |
| 最終ジャッジ日時 | 2025-01-05 02:52:00 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, n;
cin >> h >> n;
int cnt = 0;
for (int i = 0; i + 1 < n; ++i) {
int g;
cin >> g;
cnt += g > h;
}
cout << cnt + 1;
if (cnt % 10 == 0) cout << "st";
else if (cnt % 10 == 1) cout << "nd";
else if (cnt % 10 == 2) cout << "rd";
else cout << "th";
cout << endl;
return 0;
}