結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
jellyfish_26
|
| 提出日時 | 2017-09-12 15:44:29 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 548 bytes |
| コンパイル時間 | 1,369 ms |
| コンパイル使用メモリ | 162,288 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-07 17:21:49 |
| 合計ジャッジ時間 | 1,960 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 6 WA * 3 |
ソースコード
#include <bits/stdc++.h>
int main() {
int H,N;
std::cin >> H >> N;
std::priority_queue <int> high;
high.push(H);
int Ha;
for(int a = 2; a <= N; ++a) {
std::cin >> Ha;
high.push(Ha);
}
int ans = 0;
while(!high.empty()) {
if(high.top() == H) {
++ans;
break;
}else{
++ans;
}
high.pop();
}
if(ans == 1) std::cout << "1st" << std::endl;
if(ans == 2) std::cout << "2nd" << std::endl;
if(ans == 3) std::cout << "3rd" << std::endl;
if(ans >= 4) std::cout << ans << "th" << std::endl;
}
jellyfish_26