You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
379 B
22 lines
379 B
#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;
|
|
} |