样例都过了啊
#include <bits/stdc++.h>
using namespace std;
#define int long long
struct node
{
int id, t;
};
struct node t[100010];
bool cmp(node a, node b)
{
return a.t < b.t;
}
signed main()
{
int n;
cin >> n;
for(int i = 1; i <= n; i ++ )
{
cin >> t[i].t;
t[i].id = i;
}
sort(t + 1, t + n + 1, cmp);
int j = n - 1;
double ans;
for(int i = 1; i <= n; i ++ )
{
ans = ans + j * t[i].t;
printf("%lld ", t[i].id);
j --;
}
printf("\n");
printf("%.2f ", ans / n);
return 0;
}