結果

問題 No.2815 Smaller than all
ユーザー kotatsugame
提出日時 2024-07-19 23:41:01
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 23 ms / 2,000 ms
コード長 302 bytes
コンパイル時間 444 ms
コンパイル使用メモリ 59,136 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-06-20 02:15:20
合計ジャッジ時間 2,282 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cassert>
using namespace std;
int N,A[2<<17];
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cin>>N;
	for(int i=0;i<N;i++)cin>>A[i];
	int up=0;
	while(up<N-1&&A[up]>=A[up+1])up++;
	int same=0;
	for(int i=up;i>=0&&A[i]==A[up];i--)same++;
	cout<<same<<endl;
}
0