题目连接如下:求K-Pairs
这道题考察的是堆排序(直接上代码):
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
struct element
{
int sum ;
unsigned int x;
unsigned int y;
}*pelement;
static bool cmp(element a, element b)
{
return (a.sum > b.sum);
}
e