delete pics to save space

This commit is contained in:
2023-08-03 09:22:52 +08:00
commit de60cd6ed4
1334 changed files with 66221 additions and 0 deletions

23
1.1090.cpp Normal file
View File

@ -0,0 +1,23 @@
// luogu-judger-enable-o2
#include<bits/stdc++.h>
using namespace std;
int n,x,res;
priority_queue<int,vector<int>,greater<int>> Q;
int main()
{
scanf("%d",&n);
while(n-->0)
{
scanf("%d",&x);
Q.push(x);
}
while(Q.size()>=2)
{
int a=Q.top(); Q.pop();
a+=Q.top(); Q.pop();
Q.push(a);
res+=a;
}
printf("%d\n",res);
return 0;
}