結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-09-08 22:23:25 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 400 bytes |
| コンパイル時間 | 1,604 ms |
| コンパイル使用メモリ | 168,400 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 11:59:08 |
| 合計ジャッジ時間 | 2,161 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
int t[2000];
int main() {
int h,n;scanf("%d%d",&h,&n);
rep(i,n-1){
scanf("%d",&t[i]);
}
sort(t,t+n-1,greater<>());
t[n-1]=-1;
rep(i,n){
if(t[i]<h){
cout<<i+1;
if((i+1)%10==1)puts("st");
else if((i+1)%10==2)puts("nd");
else if((i+1)%10==3)puts("rd");
else puts("th");
return 0;
}
}
}