摘要:
当数据范围较大需要离散化,因此需要排序,所以这种情况下不如直接用归并排序。 #include<bits/stdc++.h> using namespace std; const int N=5e5+5; int n; int a[N],b[N]; int c[N]; int ask(int x) { 阅读全文
摘要:
模板一(单点操作): #include<bits/stdc++.h> using namespace std; const int N=5e5+5; int n,m; int a[N]; int c[N]; void add(int x,int y) { for(; x<=n; x+=x&-x) c 阅读全文
摘要:
1 struct rec { 2 int a, b; // 两个变量,其中a>=b 3 int val, cnt; // 未来估价val,当前次数cnt 4 rec() {} 5 rec(int a_, int b_, int val_, int cnt_) { 6 a = a_, b = b_, 阅读全文