結果

問題 No.2815 Smaller than all
ユーザー MagentorMagentor
提出日時 2024-06-19 06:19:52
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 778 bytes
コンパイル時間 3,089 ms
コンパイル使用メモリ 244,988 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-20 12:35:38
合計ジャッジ時間 6,111 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 1 ms
5,376 KB
testcase_02 AC 9 ms
5,376 KB
testcase_03 AC 8 ms
5,376 KB
testcase_04 AC 53 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 73 ms
5,376 KB
testcase_09 AC 73 ms
5,376 KB
testcase_10 AC 72 ms
5,376 KB
testcase_11 AC 73 ms
5,376 KB
testcase_12 AC 71 ms
5,376 KB
testcase_13 AC 66 ms
5,376 KB
testcase_14 AC 69 ms
5,376 KB
testcase_15 AC 72 ms
5,376 KB
testcase_16 AC 66 ms
5,376 KB
testcase_17 AC 56 ms
5,376 KB
testcase_18 AC 64 ms
5,376 KB
testcase_19 AC 68 ms
5,376 KB
testcase_20 AC 59 ms
5,376 KB
testcase_21 AC 72 ms
5,376 KB
testcase_22 AC 73 ms
5,376 KB
testcase_23 AC 58 ms
5,376 KB
testcase_24 AC 67 ms
5,376 KB
testcase_25 AC 70 ms
5,376 KB
testcase_26 AC 60 ms
5,376 KB
testcase_27 AC 65 ms
5,376 KB
testcase_28 AC 67 ms
5,376 KB
testcase_29 AC 66 ms
5,376 KB
testcase_30 AC 74 ms
5,376 KB
testcase_31 AC 73 ms
5,376 KB
testcase_32 AC 2 ms
5,376 KB
testcase_33 AC 73 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

template<typename T> inline bool chmax(T &a, T b) { return ((a < b) ? (a = b, true) : (false)); }
template<typename T> inline bool chmin(T &a, T b) { return ((a > b) ? (a = b, true) : (false)); }
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)
#define rep2(i, m ,n) for (int i = (m); i < (long long)(n); i++)
#define REP(i, n) for (long long i = 1; i < (long long)(n); i++)
typedef long long ll;
#define updiv(N,X) (N + X - 1) / X
#define all(n) n.begin(),n.end()
#define YesNo(Q) Q==1?cout<<"Yes":cout<<"No"



int main(){
int n;cin>>n;
vector<int> a(n);
rep(i,n){cin>>a[i];}
ll mx = 0;
rep(i,n-1){
  if(a[i]>=a[i+1]){mx++;}
  else{break;}
}
ll res = 0;
rep(i,mx+1){
  if(a[mx]==a[i]){res++;}
}
cout<<res<<endl;
}
0