結果
| 問題 | No.564 背の順 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-05-05 19:12:32 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 499 bytes |
| 記録 | |
| コンパイル時間 | 609 ms |
| コンパイル使用メモリ | 78,912 KB |
| 実行使用メモリ | 7,716 KB |
| 最終ジャッジ日時 | 2026-03-11 21:18:02 |
| 合計ジャッジ時間 | 994 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <iostream>
#include <algorithm>
#include <array>
using namespace std;
int main(){
int HiN,Nu;
cin>>HiN>>Nu;
Nu--;
int* NuO=new int[Nu];
int x=0,y=0;
while(x<Nu){
cin>>NuO[x];
x++;
}
sort(NuO,NuO+Nu,greater<int>());
x=0;
while(x==0){
if(NuO[y]<=HiN){
x++;
}else{
y++;
if(y==Nu){
x++;
}
}
}
y++;
switch(y%10){
case 1: cout<<y<<"st"<<endl; break;
case 2: cout<<y<<"nd"<<endl; break;
case 3: cout<<y<<"rd"<<endl; break;
default: cout<<y<<"th"<<endl; break;
}
return 0;
}