文章
71
粉丝
142
获赞
5
访问
52.9k
#include<iostream>
#include<string>
#include<queue>
using namespace std;
int main(){
int n;
while (cin>>n) {
priority_queue<int,vector<int>,greater<int>> q;
int s;
for (int i = 0; i < n;i++) {
cin >> s;
q.push(s);
}
int ans = 0;
while (q.size()>1) {
int a = q.top();
q.pop();
int b = q.top();
q.pop();
...
登录后发布评论
暂无评论,来抢沙发