結果
| 問題 | 
                            No.564 背の順
                             | 
                    
| コンテスト | |
| ユーザー | 
                             yui
                         | 
                    
| 提出日時 | 2019-01-29 22:20:17 | 
| 言語 | C++14  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 366 bytes | 
| コンパイル時間 | 1,621 ms | 
| コンパイル使用メモリ | 167,840 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-10-11 22:16:11 | 
| 合計ジャッジ時間 | 2,243 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge4 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 WA * 1 | 
| other | AC * 2 WA * 7 | 
ソースコード
#include "bits/stdc++.h"
using namespace std;
signed main() {
	int h, n;
	cin >> h >> n;
	int num =1;
	for (int i = 0; i < n - 1; i++) {
		int hl;
		cin >> hl;
		if (h < hl) {
			num++;
		}
	}
	string res = to_string(num);
	if (num == 1) {
		res += "st";
	}
	else if (num == 2) {
		res += "nd";
	}
	else if (num == 3) {
		res += "rd";
	}
	cout << res << endl;
	
}
            
            
            
        
            
yui