結果

問題 No.564 背の順
ユーザー cureskol
提出日時 2020-03-31 16:32:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 368 bytes
コンパイル時間 1,837 ms
コンパイル使用メモリ 172,208 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-24 19:57:43
合計ジャッジ時間 2,490 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 6 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

void f(int a){
  cout<<a+1;
  if(a==0)cout<<"st";
  if(a==1)cout<<"nd";
  if(a==2)cout<<"rd";
  if(a>=3)cout<<"th";
  cout<<endl;
  exit(0);
}

signed main(){
  int h;cin>>h;
  int n;cin>>n;
  vector<int> v(n);v[0]=h;
  for(int i=1;i<n;i++)cin>>v[i];
  sort(v.rbegin(),v.rend());
  for(int i=0;i<n;i++)if(v[i]==h)f(i);
}
0