結果
問題 | No.564 背の順 |
ユーザー |
![]() |
提出日時 | 2019-09-14 00:45:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 308 bytes |
コンパイル時間 | 1,221 ms |
コンパイル使用メモリ | 159,208 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-04 10:57:09 |
合計ジャッジ時間 | 1,790 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for(int i = 0; i < (int)(n); i++) using namespace std; int main(){ int H,N; cin >> H >> N; int h; int ans = 1; string st[4] ={"st","nd","rd","th"}; rep(i,N-1){ cin >> h; if (H < h) ans++; } cout << ans << st[min({(ans-1)%10,3})] <<endl; }