結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-03-30 00:05:49 |
| 言語 | C++11(廃止可能性あり) (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 456 bytes |
| 記録 | |
| コンパイル時間 | 1,249 ms |
| コンパイル使用メモリ | 160,344 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-29 19:02:35 |
| 合計ジャッジ時間 | 1,934 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
int main(){
int h,n;
cin >> h >> n;
int h1[n];
h1[0]=h;
for(int i=1; i<n; i++) cin >> h1[i];
sort(h1,h1+n);
//for(int i=0; i<n; i++) cout << h1[i] << endl;
int i;
for(i=0; i<n; i++) if(h1[i]==h) break;
i=n-i;
cout << i;
if(i==1) cout << "st" << endl;
else if(i==2) cout << "nd" << endl;
else if(i==3) cout << "rd" << endl;
else cout << "th" << endl;
}