結果

問題 No.2036 Max Middle
コンテスト
ユーザー okkuu
提出日時 2022-08-12 21:47:40
言語 C++23
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 56 ms / 2,000 ms
+ 362µs
コード長 621 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,300 ms
コンパイル使用メモリ 215,164 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-09-02 21:29:01
合計ジャッジ時間 4,085 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<iomanip>
#include<numeric>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<random>
#include<bitset>
#include<cassert>
#include<complex>
#include<fstream>
using namespace std;
typedef long long ll;
const int mod=998244353;
const int dx[]={1,0,0,-1},dy[]={0,1,-1,0};
int main(){
	static int n,a[200000];
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	ll ans=0;
	int tmp=0;
	for(int i=0;i<n-1;i++)
		if(a[i]<a[i+1])
			tmp++;
		else
			ans+=tmp;
	cout<<ans<<endl;
}
0