結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2019-01-29 22:25:17 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 391 bytes |
コンパイル時間 | 1,675 ms |
コンパイル使用メモリ | 166,812 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-11 22:21:09 |
合計ジャッジ時間 | 2,111 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include "bits/stdc++.h" using namespace std; signed main() { int h, n; cin >> h >> n; int num =1; for (int i = 0; i < n - 1; i++) { int hl; cin >> hl; if (h < hl) { num++; } } string res = to_string(num); if (num == 1) { res += "st"; } else if (num == 2) { res += "nd"; } else if (num == 3) { res += "rd"; } else { res += "th"; } cout << res << endl; }