摘要:
主要是利用快排的RANDOMIZED_PARTTITION()函数返回一个第q小的数,且第q小的数的坐标是绝对坐标而不是相对坐标,比如输入坐标范围为[p,r]的数组,第q小的数会返回p+q-1的坐标。 阅读全文
posted @ 2017-03-17 23:32
lineaar
阅读(261)
评论(0)
推荐(0)
摘要:
#include "stdafx.h" #include #include #include using namespace std; int RANDOM(int p, int r) { srand((unsigned)time(NULL)); return (rand() % (r - p + 1)) + p; } int partition(int a[], int p, ... 阅读全文
posted @ 2017-03-17 22:35
lineaar
阅读(144)
评论(0)
推荐(0)
摘要:
#include "stdafx.h" #include #include #include #include using namespace std; int main() { stack stk; string str; cin >> str; char h; int sum, b; for (int i = 0; i = 'A'&&str[i] <= 'F') ... 阅读全文
posted @ 2017-03-17 21:24
lineaar
阅读(271)
评论(0)
推荐(0)

浙公网安备 33010602011771号