- 博客(7)
- 收藏
- 关注
原创 线段树套平衡树
#include <iostream> #include <cstring> #include <algorithm> #include <set> using namespace std; const int N = 50010,M=4*N,INF=1e9; int n,m; int w[N]; struct Node{ int l,r; multiset<int> s; }tr[M]; void build(int u,int
2021-12-19 23:18:33
119
原创 shell全排列
#! /bin/bash read n read m for (( i=1;i<=n;i++ )) do st[$i]=0 done dfs() { if [ $n -eq $1 ] then m=`expr $m - 1` if [ $m -eq 0 ] then echo ${path[@]} return 0 fi return 1
2021-11-29 22:21:51
317
原创 初等线段树
初等线段树,没有懒标记,pushdown,维护最大值 #include<bits/stdc++.h> using namespace std; const int N=2e5+10; int m,p; struct Node{ int l,r; int v; }tr[4*N]; int query(int u,int l,int r) { if(tr[u].l>=l&&tr[u].r<=r)return tr[u].v; int v=0
2021-11-14 22:14:47
248
原创 学习笔记2
字典树 #include<bits/stdc++.h> using namespace std; const int N=100010; int ne[N][26],idx,cnt[N]; void insert(string a) {int p=0; for(int i=0;i<a.size();i++) { int u=a[i]-'a'; if(!ne[p][u])ne[p][u]=++idx; p=ne[p][u];
2021-10-25 06:39:03
93
原创 acwing学习记录
数据结构 并查集 #include <bits/stdc++.h> using namespace std; int a[100010]; int root(int x) { if(x!=a[x])return a[x]=root(a[x]); return x; } void merge_root(int x,int y) {int i=root(x),j=root(y); if(i!=j) a[i]=root(a[j]); } int main() { int n,m;
2021-10-10 17:07:14
96
原创 楼兰图腾题目理解(不包括树状数组)
楼兰图腾(AcWing) 在完成了分配任务之后,西部 314 来到了楼兰古城的西部。 相传很久以前这片土地上(比楼兰古城还早)生活着两个部落,一个部落崇拜尖刀(V),一个部落崇拜铁锹(∧),他们分别用 V 和 ∧ 的形状来代表各自部落的图腾。 西部 314 在楼兰古城的下面发现了一幅巨大的壁画,壁画上被标记出了 n 个点,经测量发现这 n 个点的水平位置和竖直位置是两两不同的。 西部 314 认为这幅壁画所包含的信息与这 n 个点的相对位置有关,因此不妨设坐标分别为 (1,y1),(2,y2),…,(n,y
2021-04-07 23:59:56
210
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人