結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2018-03-28 22:53:02 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 493 bytes |
コンパイル時間 | 502 ms |
コンパイル使用メモリ | 60,752 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-25 13:22:11 |
合計ジャッジ時間 | 1,063 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 WA * 1 |
other | AC * 8 WA * 1 |
ソースコード
#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 << count << "st" << endl; }else if(count%10==2){ cout << count << "nd" << endl; }else if(count%10==3){ cout << count << "rd" << endl; }else{ cout << count << "th" << endl; } return 0; }