摘要: 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1280题目大意为求一数组的前M大的和,利用C++ sort函数轻松解决;整个题目从构思到解决用了20分钟,感觉还不错!!!另外说一下,数组要开的足够大。。。。。。1500*2999=4498500至少要不小于此,,,,,,,,,,,,,,,,,代码如下: 1 #include 2 #include 3 int st1[3005],sum[5000000]; 4 using namespace std; 5 int main() 6 { 7 int i,j,k,t; 8 int ... 阅读全文