結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 22:39:06 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 1,520 bytes |
| コンパイル時間 | 780 ms |
| コンパイル使用メモリ | 90,612 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 12:10:07 |
| 合計ジャッジ時間 | 1,308 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 WA * 2 |
| other | AC * 1 WA * 8 |
ソースコード
#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;
}