結果

問題 No.564 背の順
ユーザー jiang0503
提出日時 2017-09-25 22:32:30
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 518 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 55,356 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-14 13:23:39
合計ジャッジ時間 1,027 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>

using namespace std;


int main() {

    int h, n;

    cin>>h>>n;

    int height[n];
    height[0]=h;

    for(int i=1; i<n; i++){
        cin>>height[i];
    }

    int count=1;
    for(int i=1; i<n; i++){
        if(height[0]<height[i]) count++;
    }

    if(count%10==1){
        cout<<count<<"st"<<endl;
    }else if(count%10==2){
        cout<<count<<"nd"<<endl;
    }else if(count%10==3){
        cout<<count<<"rd"<<endl;
    }else{
        cout<<count<<"th"<<endl;
    }

    return 0;
}
0