結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2019-09-06 07:01:59 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 444 bytes |
コンパイル時間 | 1,851 ms |
コンパイル使用メモリ | 173,528 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-23 11:04:00 |
合計ジャッジ時間 | 2,259 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int n,t; cin>>t>>n; vector<int> h(n); h[0]=t; for(int i=1;i<n;i++)cin>>h[i]; sort(h.begin(),h.end()); reverse(h.begin(),h.end()); auto m=find(h.begin(),h.end(),t); int d=distance(h.begin(),m)+1; if(d==1)cout<<1<<"st"<<endl; else if(d==2)cout<<2<<"nd"<<endl; else if(d==3)cout<<3<<"rd"<<endl; else cout<<d<<"th"<<endl; return 0; }