結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 22:22:25 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 420 bytes |
| コンパイル時間 | 627 ms |
| コンパイル使用メモリ | 72,392 KB |
| 最終ジャッジ日時 | 2025-01-05 02:45:20 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
#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 == 1) {
cout << "st";
} else if (rank == 2) {
cout << "nd";
} else if (rank == 3) {
cout << "rd";
} else {
cout << "th";
}
}