結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 23:25:55 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,006 bytes |
| コンパイル時間 | 769 ms |
| コンパイル使用メモリ | 90,084 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 12:14:31 |
| 合計ジャッジ時間 | 1,357 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;
#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
ll A, N;
cin >> A >> N;
vector<ll> H; H.pb(A);
rep(i,N-1){ ll inp; cin >> inp; H.pb(inp);}
sort(rall(H));
rep(i,N){
if(H[i]==A) {
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;
}