Submission
Status:
PPPPPPPPPP
Subtask/Task Score:
100/100
Score: 100
User: Dormon
Problemset: เพนกวิน
Language: cpp
Time: 0.002 second
Submitted On: 2025-05-31 14:18:22
#include <iostream>
#include <vector>
using namespace std;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(0);
int n, ans = 0;
cin >> n;
vector<int> v(n);
for (auto &e:v)
cin >> e;
for (int i = 0;i < n;i++)
for (int j = 0;j < i;j++)
ans += v[i] > v[j];
cout << ans << '\n';
}