摘要: #include<bits/stdc++.h> using namespace std; int cnt;//总共有多少个节点 struct node { int l,r;//左儿子 右儿子编号 int sum;//区间和 node(){ l=r=sum=0; } }z[maxn*logn]; vo 阅读全文
posted @ 2025-06-21 20:41 Fire_poetry 阅读(6) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; const int mo = 1000000007; inline void inc(int &a,int b) { a+=b;if (a>=mo) a-=mo; } #define inc(a,b) {a+= 阅读全文
posted @ 2025-06-21 20:41 Fire_poetry 阅读(9) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define root 1,n,1 #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxn=100010; int n,m,a[max 阅读全文
posted @ 2025-06-21 20:40 Fire_poetry 阅读(7) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define root 1,n,1 #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxn=100010; int n,m,a[max 阅读全文
posted @ 2025-06-21 20:40 Fire_poetry 阅读(14) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define root 1,n,1 #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxn=100010; int n,m,a[max 阅读全文
posted @ 2025-06-21 20:38 Fire_poetry 阅读(3) 评论(0) 推荐(0)
摘要: #include<bits/stdc++.h> using namespace std; #define root 1,n,1 #define lson l,m,rt<<1 #define rson m+1,r,rt<<1|1 const int maxn=100010; int n,m,a[max 阅读全文
posted @ 2025-06-21 20:37 Fire_poetry 阅读(4) 评论(0) 推荐(0)
摘要: int go(int p)//从p点出发 看最后会走到哪里 { if (p == to[p]) return p; else return go(to[p]); } int main () { cin >> n; for (int i=1;i<=n;i++) to[i] = i; //合并 to[g 阅读全文
posted @ 2025-06-21 20:37 Fire_poetry 阅读(5) 评论(0) 推荐(0)
摘要: struct node { int nxt[2];//nxt[0] nxt[1] 代表从当前点走0和1会走到哪里 走到0的话代表这个节点不存在 node() { nxt[0] = nxt[1] = 0; } }z[23333]; void insert(int x) { int p=root; fo 阅读全文
posted @ 2025-06-21 20:37 Fire_poetry 阅读(6) 评论(0) 推荐(0)
摘要: struct query { int l,r,id,ans; }q[maxn]; bool cmp1(const query &q1, const query &q2) { if (belong[q1.l] != belong[q2.l]) return belong[q1.l] < belong[ 阅读全文
posted @ 2025-06-21 20:37 Fire_poetry 阅读(6) 评论(0) 推荐(0)
摘要: #include<queue> //#include<bits/stdc++.h> using namespace std; queue<int> q; //queue<队列里面的元素类型> 变量名; int main() { q.push(233); q.push(2233);//向队列里面加入一 阅读全文
posted @ 2025-06-21 20:35 Fire_poetry 阅读(4) 评论(0) 推荐(0)