12 2016 档案
摘要:1 #include 2 #include 3 using namespace std; 4 struct node 5 { 6 int v; 7 int df; 8 node * left_c; 9 node * right_c; 10 }; 11 void right_rotate(node *&ptr) 12 {...
阅读全文
摘要:1 #include <iostream> 2 #include <cstdio> 3 using namespace std; 4 int a[100]; 5 void qsort(int *s,int *e) 6 { 7 if (s>=e) return; 8 int mid = *(s+(e-
阅读全文
摘要:裸基数排序 #include <iostream> using namespace std; struct list_ { int v; int next; }a[1005]; void print(list_ a[],int head) { for (int i = head; i != -1;
阅读全文
摘要:#include <iostream> using namespace std; int tem[1005]; int a[1005]; bool com1(int x,int y) { return x >= y; } bool com2(int x ,int y) { return x <=y;
阅读全文
摘要:#include using namespace std; int a[1005]; bool com1(int a,int b) { return a > b; } bool com2(int a,int b) { return a =1; i--) adjust(a,i,n,com); for (int i = n-1; i>=1 ; i--) ...
阅读全文
摘要:二分答案X,判断能否通过均分比X大的橘子,使得数量>=K。 对于给定x,均分A[i],能分得的种类数是 x * 2的t次方 <= A[i] 的最大的t 易知 求得t后,所分得的权值差只有可能为1,即分得一堆Z和一堆Z+1 有时候虽然Z没有分的必要,但是Z+1还有继续分的必要,所以对于(Z+1) ==
阅读全文

浙公网安备 33010602011771号