@[alcoholic_](/user/956463) ```int main()```
by codejiahui @ 2023-04-04 11:26:21
@[alcoholic_](/user/956463)
```
#include<iostream>
#include<algorithm>
using namespace std;
struct peo{int id,t;}a[100010];
bool cmp(peo x,peo y)
{
return x.t < y.t;
}
int main()
{
int n;
long long ans = 0;
scanf("%d",&n);
for (int i = 1;i <= n;i++)
{
scanf("%d",&a[i].t);
a[i].id = i;
}
sort(a + 1,a + n + 1,cmp);
for (int i = 1;i <= n;i++)
{
printf("%d ",a[i].id);
ans += a[i].t * (n - i);
}
printf("\n%.2lf",ans * 1.0 / n);
return 0;
}
```
另外,[关注](https://www.luogu.com.cn/user/512407)一下吧
by codejiahui @ 2023-04-04 11:30:58
@[codejiahui](/user/512407) 你是对的,但请关注 @[linzhicong2011](/user/661534) 谢谢喵
by Dehydration @ 2023-04-04 12:45:43
@[codejiahui](/user/512407) 对奥,我在devcpp为了方便,就用的void main , 忘记换回来了 谢谢了
by alcoholic_ @ 2023-04-05 08:54:52
@[codejiahui](/user/512407) 互关互关,哈哈哈
by alcoholic_ @ 2023-04-05 08:56:25
@[linzhicong2011](/user/661534) 互关就关注
by alcoholic_ @ 2023-04-05 08:56:51