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.
20 lines
593 B
20 lines
593 B
#include <bits/stdc++.h>
|
|
|
|
using namespace std;
|
|
const int N = 110;
|
|
int a[N], b[N], n;
|
|
|
|
int main() {
|
|
cin >> n;
|
|
//每一条小鱼的可爱值
|
|
for (int i = 1; i <= n; i++) cin >> a[i];
|
|
|
|
//每一条小鱼向左看
|
|
for (int i = 1; i <= n; i++)
|
|
for (int j = i - 1; j >= 1; j--) //每一条小鱼去看它左边的每一条小鱼
|
|
if (a[j] < a[i]) b[i]++; //如果它左边的某条小鱼可爱值不如自己,则自信心++
|
|
|
|
//输出每一条小鱼的自信心值
|
|
for (int i = 1; i <= n; i++) cout << b[i] << " ";
|
|
return 0;
|
|
} |