摘要: 数颜色 点击查看代码 #include<bits/stdc++.h> using namespace std; #define N 300005 #define mid ((l+r)>>1) int n,m,a[N]; int root[N],tot;//根节点,开点个数 int ls[N*25], 阅读全文
posted @ 2025-09-03 11:39 Lucian2007 阅读(12) 评论(0) 推荐(0)
摘要: 逆序对 点击查看代码 #include<bits/stdc++.h> using namespace std; #define ls u<<1 #define rs u<<1|1 #define mid ((l+r)>>1) #define LL long long const int N=5000 阅读全文
posted @ 2025-08-31 11:13 Lucian2007 阅读(11) 评论(0) 推荐(0)
摘要: 打印机 点击查看代码 #include<bits/stdc++.h> using namespace std; #define mid ((l+r)>>1) const int N=100005; int tot,cnt,root[N]; int ls[N*20],rs[N*20],sum[N*20 阅读全文
posted @ 2025-08-31 11:07 Lucian2007 阅读(10) 评论(0) 推荐(0)
摘要: https://www.luogu.com.cn/problem/P1438 点击查看代码 #include<bits/stdc++.h> using namespace std; #define LL long long #define ls u<<1 #define rs u<<1|1 #def 阅读全文
posted @ 2025-08-30 15:39 Lucian2007 阅读(5) 评论(0) 推荐(0)
摘要: P3919 点击查看代码 #include<bits/stdc++.h> #define N 1000005 #define mid ((l+r)>>1) using namespace std; int n,m,a[N]; int root[N],tot;//根节点,节点个数 int ls[N*2 阅读全文
posted @ 2025-08-30 12:06 Lucian2007 阅读(6) 评论(0) 推荐(0)
摘要: P4556 [Vani有约会] 雨天的尾巴 /【模板】线段树合并 点击查看代码 #include <iostream> #include <cstring> #include <algorithm> #include <vector> using namespace std; void read(i 阅读全文
posted @ 2025-08-28 13:56 Lucian2007 阅读(8) 评论(0) 推荐(0)
摘要: 洛谷P1600 点击查看代码 #include<bits/stdc++.h> #define N 500005 #define mid (l+r)/2 using namespace std; int n,m,w[N],ans[N]; vector<int>g[N]; int fa[N][20],d 阅读全文
posted @ 2025-08-27 21:24 Lucian2007 阅读(6) 评论(0) 推荐(0)