随笔分类 -  御用模板

摘要:配合__int128使用 inline int read() { char c = getchar(); int x = 0, f = 1; while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();} while(c >= '0' 阅读全文
posted @ 2020-03-03 20:09 _LH2000 阅读(165) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define rush! ios::sync_with_stdio(false);cin.tie(0); c 阅读全文
posted @ 2020-02-27 16:58 _LH2000 阅读(138) 评论(0) 推荐(0)
摘要:有两种方法,只贴出较为简便的一种 stl 实现离散化 #include<algorithm> // 头文件 //n 原数组大小 num 原数组中的元素 lsh 离散化的数组 cnt 离散化后的数组大小 int lsh[MAXN] , cnt , num[MAXN] , n; for(int i=1; 阅读全文
posted @ 2020-02-27 15:11 _LH2000 阅读(164) 评论(0) 推荐(0)
摘要:#include<bits/stdc++.h> using namespace std; #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 #define rush! ios::sync_with_stdio(false);cin.tie(0); # 阅读全文
posted @ 2020-02-26 18:00 _LH2000 阅读(160) 评论(0) 推荐(0)
摘要:区间修改 单点查询 int n,m; int a[50005] = {0},c[50005]; //对应原数组和树状数组 int lowbit(int x){ return x&(-x); } void updata(int i,int k){ //在i位置加上k while(i <= n){ c[ 阅读全文
posted @ 2020-02-26 15:34 _LH2000 阅读(120) 评论(0) 推荐(0)