| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 167786 | 谢宗晋 | 紧急集合 | C++ | Compile Error | 0 | 0 MS | 0 KB | 318 | 2024-08-19 17:28:57 |
#include<bits/stdc++.h> using namespace std; priority_queue<int, vector, greater > q; int n,ans; signed main(){ cin>>n; for(int i=1;i<=n;i++){ int x; cin>>x; q.push(x); } while(q.size()>1){ int x=q.top(); q.pop(); int y=q.top(); q.pop(); ans+=x+y; q.push(x+y); }cout<<ans; return 0; }