結果
問題 | No.564 背の順 |
ユーザー |
![]() |
提出日時 | 2017-09-08 22:45:49 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 738 bytes |
コンパイル時間 | 1,575 ms |
コンパイル使用メモリ | 162,940 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 05:41:43 |
合計ジャッジ時間 | 2,227 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include<bits/stdc++.h>using namespace std;#define int long long#define rep(i,n) for(int i=0;i<(n);i++)#define pb push_back#define all(v) (v).begin(),(v).end()#define fi first#define se secondtypedef vector<int>vint;typedef pair<int,int>pint;typedef vector<pint>vpint;template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}signed main(){int H,N;cin>>H>>N;vint A(N-1);rep(i,N-1)cin>>A[i];sort(all(A));int tmp=lower_bound(all(A),H)-A.begin();tmp=N-tmp;if(tmp==1)cout<<"1st"<<endl;else if(tmp==2)cout<<"2nd"<<endl;else if(tmp==3)cout<<"3rd"<<endl;else cout<<tmp<<"th"<<endl;return 0;}