結果
| 問題 |
No.564 背の順
|
| コンテスト | |
| ユーザー |
hogeover30
|
| 提出日時 | 2018-01-17 17:10:28 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 10 ms / 2,000 ms |
| コード長 | 341 bytes |
| コンパイル時間 | 2,223 ms |
| コンパイル使用メモリ | 200,724 KB |
| 最終ジャッジ日時 | 2025-01-05 07:34:44 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 9 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int h, n; cin>>h>>n;
vector<int> a(n-1);
for(int& e: a) cin>>e;
a.push_back(h);
sort(rbegin(a), rend(a));
for(int i=1; i<=n; ++i) {
if (a[i-1]==h) {
int t=i%10;
cout<<i<<"th\0st\0nd\0rd"+3*(t<4?t:0)<<endl;
}
}
}
hogeover30