結果

問題 No.564 背の順
ユーザー zuvizudarzuvizudar
提出日時 2017-09-08 22:39:06
言語 C++11
(gcc 11.4.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 1,520 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 90,360 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-25 02:35:36
合計ジャッジ時間 1,467 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define F(i,j,k) fill(i[0],i[0]+j*j,k)
#define P(p) cout<<(p)<<endl;
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define INF 1<<25
#define pb push_back
 
typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int,int> pii;
typedef pair<long,long> pll;
typedef long long ll;
/*
 struct TALL{
	int cm;
	int n;
	bool operator<( const TALL& right ) const {
	        return cm == right.cm ? n < right.n : n < right.n;
	    }
};
int main(){
	int a,b,c,d;
	TALL h[1001];
	cin>>h[0].cm>>a;
	h[0].n=1;
	REP(i,1,a){
		cin>>h[i].cm;
		h[i].n=i+1;
	}
	sort(h,h+a);
	rep(i,a){
		if(h[i].cm==b){
			cout<<i+1<<endl;
			return 0;	
		}
	}


	return 0;
}
*/

int main(){
	int h,n;
	int H[1001];
	cin>>h>>n;
	REP(i,0,n-1)
		cin>>H[i];
	sort(H,H+n,greater<int>());
	rep(i,n){
		if(H[i]<h){
			cout<<i+1;
			if((i+1)%10==1)
				cout<<"st"<<endl;
			else if((i+1)%10==2)
				cout<<"nd"<<endl;
			else if((i+1)%10==3)
				cout<<"rd"<<endl;
			else	
				cout<<"th"<<endl;
			return 0;
		}
	}
	return 0;
}

0