結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
notetonous
|
| 提出日時 | 2017-09-08 22:29:30 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 458 bytes |
| コンパイル時間 | 623 ms |
| コンパイル使用メモリ | 61,752 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 12:06:26 |
| 合計ジャッジ時間 | 1,131 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;
int H[100],N;
int x;
int main(){
cin >> x >> N;
H[0]=x;
for(int i=1;i<N;i++)cin >> H[i];
sort(H,H+N);
reverse(H,H+N);
for(int i=0;i<N;i++){
if(H[i]==x){
x=i;
break;
}
}
x++;
if(x%10==1)printf("%dst\n",x);
else if(x%10==2)printf("%dnd\n",x);
else if(x%10==3)printf("%drd\n",x);
else printf("%dth\n",x);
return 0;
}
notetonous