90分,#2TLE
查看原帖
90分,#2TLE
1329138
luogu_hezhenmin1楼主2024/8/28 10:43
#include<bits/stdc++.h>
#define ull unsigned long long
using namespace std;
int n,a[80002];
ull ans=0;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0),cout.tie(0);
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
    for(int i=1;i<n;i++){
		int sum=a[i];
		for(int j=i+1;j<=n;j++){
			if(sum<=a[j]) break;
			else ans++;
		}
	}
	cout<<ans;
	return 0;
}
2024/8/28 10:43
加载中...