結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
mkan
|
| 提出日時 | 2017-09-09 18:55:58 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,183 bytes |
| コンパイル時間 | 648 ms |
| コンパイル使用メモリ | 77,992 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-06-30 03:10:00 |
| 合計ジャッジ時間 | 1,059 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <ctime>
#define INF 2000000000
#define LINF 9000000000000000000
#define mod 1000000007
#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=(n);i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define rsort(x) sort(all(x));reverse(all(x))
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
bool debug=false;
/*---------------------------------------------------*/
int main(){
int n,h,H;
vi rank;
cin>>H>>n;
rank.pb(H);
rep(i,n-1){cin>>h;rank.pb(h);}
rsort(rank);
rep(i,n)
if(rank[i]==H){
if(i+1==1)cout<<i+1<<"st"<<endl;
else if(i+1==2)cout<<i+1<<"nd"<<endl;
else if(i+1==3)cout<<i+1<<"rd"<<endl;
else cout<<i+1<<"th"<<endl;
}
return 0;
}
mkan