using namespace std; int n,i,x,y,ans; priority_queue<int,vector,greater > p; int main() {
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&x);
p.push(x);
}
while(p.size()!=1)
{
x=pt
pp
y=pt
pp
ans+=x+y;
p.push(x+y);
}
printf("%d",ans);
return 0;
}
using namespace std; int n,i,x,y,ans; priority_queue<int,vector,greater > p; int main() {
scanf("%d",&n);
for(i=1;i<=n;i++)
{
scanf("%d",&x);
p.push(x);
}
while(p.size()!=1)
{
x=pt
pp
y=pt
pp
ans+=x+y;
p.push(x+y);
}
printf("%d",ans);
return 0;
}
比赛已结束。