結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2020-06-05 19:27:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 643 bytes |
コンパイル時間 | 891 ms |
コンパイル使用メモリ | 87,344 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-16 06:52:54 |
合計ジャッジ時間 | 1,597 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include<iostream> #include<math.h> #include<string.h> #include<vector> #include<algorithm> #include<iomanip> #include<deque> using namespace std; int main(){ int h,n; cin >> h >> n; vector<int> a; a.push_back(h); for(int i=0;i<n-1;i++){ int temp; cin >> temp; a.push_back(temp); } sort(a.begin(),a.end(),greater<int>()); for(int i=0;i<n;i++){ if(a[i]==h){ cout << i+1; if(i+1==1){ cout << "st" << endl; return 0; }else if(i+1==2){ cout << "nd" << endl; return 0; }else if(i+1==3){ cout << "rd" << endl; return 0; }else{ cout << "th" << endl; return 0; } } } return 0; }