链接: http://poj.org/problem?id=2092 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=27454#problem/D Grandpa is Famous Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 7210 Accepted: 3650 Description The whole family was excited by…
Grandpa is Famous Time Limit: 2000MS Memory Limit: 30000K Total Submissions: 7153 Accepted: 3624 Description The whole family was excited by the news. Everyone knew grandpa had been an extremely good bridge player for decades, but when it was ann…
(找第k大的数) 给定一个长度为1,000,000的无序正整数序列,以及另一个数n(1<=n<=1000000),接下来以类似快速排序的方法找到序列中第n大的数(关于第n大的数:例如序列{1,2,3,4,5,6}中第3大的数是4). #include <iostream> using namespace std; int a[1000001],n,ans = -1; void swap(int &a,int &b) { int c; c = a; a = b; b…