結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2018-03-28 22:51:25 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 469 bytes |
コンパイル時間 | 652 ms |
コンパイル使用メモリ | 59,416 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 13:22:05 |
合計ジャッジ時間 | 1,062 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 5 WA * 4 |
ソースコード
#include<iostream> #include<algorithm> using namespace std; int main(){ int nama, n; cin >> nama >> n; int h[n-1]; for(int i=0; i<n-1; i++){ cin >> h[i]; } sort(h, h+n-1); int count=1; for(int i=n-2; h[i]>nama; i--){ count++; } if(count%10==1){ cout << "1st" << endl; }else if(count%10==2){ cout << "2nd" << endl; }else if(count%10==3){ cout << "3rd" << endl; }else{ cout << count << "th" << endl; } return 0; }