結果

問題 No.564 背の順
ユーザー はむ吉🐹はむ吉🐹
提出日時 2017-10-01 15:59:55
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 677 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 67,840 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-27 17:28:35
合計ジャッジ時間 1,259 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 1 ms
5,376 KB
testcase_06 AC 1 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 1 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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;
}
0