22 lines
400 B
C++
22 lines
400 B
C++
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
|
|
int a[100], b[100], n;
|
|
|
|
int main() {
|
|
cin >> n;
|
|
for (int i = 0; i < n; i++) {
|
|
cin >> a[i];
|
|
}
|
|
|
|
for (int i = 0; i < n; i++)
|
|
for (int j = i; j >= 0; j--) {
|
|
if (a[j] < a[i])
|
|
b[i]++;
|
|
}
|
|
for (int i = 0; i < n; i++) {
|
|
cout << b[i] << " ";
|
|
}
|
|
return 0;
|
|
} |