結果
問題 |
No.564 背の順
|
ユーザー |
|
提出日時 | 2018-01-01 14:15:48 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 660 bytes |
コンパイル時間 | 1,586 ms |
コンパイル使用メモリ | 167,940 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-12-22 21:28:28 |
合計ジャッジ時間 | 2,303 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i, n) for(int i = 0; i < n; i++) int main() { ios::sync_with_stdio(false); cin.tie(0); int nama, N; cin >> nama >> N; int rank = 1; REP(i, N - 1) { int h; cin >> h; if (h > nama) rank++; } switch (rank % 10) { case 1: cout << rank << "st" << endl; break; case 2: cout << rank << "nd" << endl; break; case 3: cout << rank << "rd" << endl; break; default: cout << rank << "th" << endl; break; } return 0; }