結果
問題 | No.564 背の順 |
ユーザー |
![]() |
提出日時 | 2017-09-08 22:33:54 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 468 bytes |
コンパイル時間 | 1,552 ms |
コンパイル使用メモリ | 169,140 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 12:09:42 |
合計ジャッジ時間 | 2,103 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h>#define REP(i,n,N) for(int i=n;i<N;i++)#define p(s) cout<<(s)<<endltypedef long long ll;using namespace std;const int inf = 1e9 + 7;int A,N;int H[110];int main() {cin>>H[0]>>N;A=H[0];REP(i,1,N){cin>>H[i];}sort(H,H+N);int ans = H+N-lower_bound(H,H+N,A);if(ans%10==1) cout<<ans<<"st"<<endl;else if(ans%10==2) cout<<ans<<"nd"<<endl;else if(ans%10==3) cout<<ans<<"rd"<<endl;else cout<<ans<<"th"<<endl;return 0;}