题目链接 维护一个单点修改,区间查询的数据结构,树状数组和线段树均可以。 我写了树状数组。 #include<bits/stdc++.h> using namespace std; #define lowbit(x) (x & (-x)) char s[10]; int n; long long c ...
分类:
其他好文 时间:
2020-07-29 21:56:16
阅读次数:
86
题目链接 线段树,单点修改,区间最大值查询。 #include<bits/stdc++.h> using namespace std; const int N = 2e5 + 10; int n,m; #define mid ((l + r) >> 1) #define ls (nod << 1) ...
分类:
其他好文 时间:
2020-07-29 21:53:09
阅读次数:
77
1004.Tokitsukaze and Multiple 求和为p的倍数的块的最大数量 #include <bits/stdc++.h> using namespace std; typedef long long ll; #define rep(i, a, b) for (register in ...
分类:
其他好文 时间:
2020-07-29 17:32:55
阅读次数:
99
AcWing 826. 单链表 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int e[N],ne[N],head,idx; //初始化 void init(){ head=-1; idx=0; } //将x插到 ...
AcWing 827. 双链表 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int e[N],l[N],r[N],idx; void init(){ //0表示左端点,1表示右端点 r[0]=1; l[1]=0; ...
AcWing 828. 模拟栈 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int stk[N],tt; void init(){ tt=0; } void add(int x){ stk[++tt]=x; } ...
AcWing 829. 模拟队列 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int q[N],hh,tt; void init(){ hh=0; tt=-1; } void add(int x){ q[++tt ...
AcWing 830. 单调栈 #include <bits/stdc++.h> using namespace std; const int N=1e6+10; int n; int stk[N],tt; int main(){ cin.tie(0); ios::sync_with_stdio(f ...
2020 Multi-University Training Contest 3 施工中。。。 1004 Tokitsukaze and Multiple #include<bits/stdc++.h> #define ll long long #define maxn 100010 #define ...
分类:
其他好文 时间:
2020-07-29 14:30:59
阅读次数:
162
A. Common Prefixes 题目链接 代码: #include<bits/stdc++.h> using namespace std; const int maxn = 1e6 + 10; #define ll long long #define ios std::ios::sync_wi ...
分类:
其他好文 时间:
2020-07-29 09:52:41
阅读次数:
58