EURON problem

Here below is mine code…
so can say what wrong in my code…

#include <bits/stdc++.h>
#define ll long long int
#include
using namespace std;

int main() {
// your code goes here
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int n;
std::cin >> n;
multiset < ll > st;
// int idx=0;
ll current;
std::cin >> current;
ll last=current;
st.insert(current);
ll ans=0;
for(int i=2;i<=n;i++){
std::cin >> current;
if(current>=last){
st.insert(current);
last=current;
}
else{
// std::cout << "invalid for : "<<i << std::endl;
auto upper=st.lower_bound(current);
auto pos = distance(st.begin(), upper) + 1;
// std::cout << "upper : “<<(*upper)<<” position : "<< pos<<std::endl;
ans += i - pos ;
st.insert(current);
}
}

std::cout << ans << std::endl;
return 0;

}