結果

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

ソースコード

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==1){
        cout<<count<<"st"<<endl;
    }else if(count==2){
        cout<<count<<"nd"<<endl;
    }else if(count==3){
        cout<<count<<"rd"<<endl;
    }else{
        cout<<count<<"th"<<endl;
    }

    return 0;
}
0