20分,裂开,输入都出问题

P1090 [NOIP2004 提高组] 合并果子 / [USACO06NOV] Fence Repair G

建议换个电脑解决输入问题
by SUPERJRZ @ 2021-10-03 16:58:13


~~毒瘤C艹~~
by SUPERLWR @ 2021-10-03 16:58:14


这输入好像没问题啊
by SUPERJRZ @ 2021-10-03 16:58:53


输入有什么问题?
by SUPERJRZ @ 2021-10-03 16:59:50


```cpp #include<bits/stdc++.h> using namespace std; int n,x,y,s=0; priority_queue<int,vector<int>,greater<int> > q; int main() { cin>>n; for (int i=1;i<=n;i++){ int x; cin>>x; q.push(x); } for (int i=1;i<n;i++){ x=q.top(); q.pop(); y=q.top(); q.pop(); s=s+(x+y); q.push(x+y); } cout<<s<<endl; return 0; }
by kimi123 @ 2021-11-07 19:45:36


STLyyds!
by kimi123 @ 2021-11-07 19:46:17


|