結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
はむ吉🐹
|
| 提出日時 | 2017-10-01 15:59:55 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 677 bytes |
| コンパイル時間 | 600 ms |
| コンパイル使用メモリ | 66,904 KB |
| 最終ジャッジ日時 | 2025-01-05 03:03:20 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <cstdlib>
#include <iostream>
int main(){
std::cin.tie(nullptr);
std::ios::sync_with_stdio(false);
int h0, n;
std::cin >> h0 >> n;
int res = 1;
for (int i = 1; i <= n - 1; i++){
int h;
std::cin >> h;
if (h > h0){
res++;
}
}
std::cout << res;
switch (res % 10){
case 1:
std::cout << "st";
break;
case 2:
std::cout << "nd";
break;
case 3:
std::cout << "rd";
break;
default:
std::cout << "th";
break;
}
std::cout << std::endl;
return EXIT_SUCCESS;
}
はむ吉🐹