結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2018-08-17 11:21:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 599 bytes |
コンパイル時間 | 681 ms |
コンパイル使用メモリ | 71,344 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-08 04:25:15 |
合計ジャッジ時間 | 1,438 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include <algorithm> #include <iostream> using namespace std; int main(void){ int n,t;cin>>t>>n; int lst[n];lst[0] = t; for(int i=1;i<n;i++)cin>>lst[i]; sort(lst,lst+n,greater<int>()); for(int i=0;i<n;i++){ if(lst[i]==t){ i++; string ed; if(i==1){ ed = "st"; }else if(i==2){ ed = "nd"; }else if(i==3){ ed = "rd"; }else{ ed = "th"; } cout<<i<<ed<<endl; exit(0); } } }