結果
問題 |
No.564 背の順
|
ユーザー |
![]() |
提出日時 | 2017-09-08 22:46:49 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 664 bytes |
コンパイル時間 | 1,625 ms |
コンパイル使用メモリ | 171,604 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-07 05:42:02 |
合計ジャッジ時間 | 2,196 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 6 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int i=0; i<(n); i++) #define REP2(i,x,n) for(int i=x; i<(n); i++) #define ALL(n) begin(n),end(n) struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star; int main() { int H, N; cin >> H >> N; vector<int> vc; vc.emplace_back( H ); int height; REP( i, N - 1 ) { cin >> height; vc.emplace_back( height ); } sort( ALL( vc ) ); REP( i, N ) { if( vc[ i ] == H ) { cout << N - i; cout << ( N - i == 1 ? "st" : N - i == 2 ? "nd" : N - i == 3 ? "rd" : "th" ) << endl; } } return 0; }