結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
yukiteru
|
| 提出日時 | 2017-10-22 11:50:07 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 827 bytes |
| コンパイル時間 | 728 ms |
| コンパイル使用メモリ | 82,132 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-21 13:38:20 |
| 合計ジャッジ時間 | 1,324 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include<iostream>
#include<string>
#include<string.h>
#include<algorithm>
#include<stdio.h>
#include<cmath>
#include<vector>
#include<utility>
#include<stack>
#include<queue>
#include<list>
#include<bitset>
#define FOR(i, a, b) for(int i=(a);i<=(b);i++)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000
using namespace std;
int main(void) {
int H, n;
int h[101];
int p = 0;
cin >> H >> n;
FOR(i, 0, n - 2) {
cin >> h[i];
}
sort(h, h + n-1);
RFOR(i, n - 2, 0) {
p++;
if (H > h[i]) {
break;
}
if (i == 0) {
p = n;
break;
}
}
switch (p % 10) {
case 1:
cout << p << "st" << endl;
break;
case 2:
cout << p << "nd" << endl;
break;
case 3:
cout << p << "rd" << endl;
break;
default:
cout << p << "th" << endl;
break;
}
return 0;
}
yukiteru