結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 22:23:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 435 bytes |
| 記録 | |
| コンパイル時間 | 465 ms |
| コンパイル使用メモリ | 89,576 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-06-06 18:12:23 |
| 合計ジャッジ時間 | 1,219 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main() {
int h, n;
cin >> h >> n;
int rank = 1;
for (int i = 0; i < n - 1; i++) {
int a;
cin >> a;
if (a > h) {
rank++;
}
}
cout << rank;
if (rank % 10 == 1) {
cout << "st";
} else if (rank % 10 == 2) {
cout << "nd";
} else if (rank % 10 == 3) {
cout << "rd";
} else {
cout << "th";
}
}