摘要: #include<bits/stdc++.h> using namespace std; const int z = 4096+1024; int n, m, od[z], ans; int use = -1, _ = 0; struct line{ int t, next; } edge[z<<2 阅读全文
posted @ 2022-02-16 10:41 bikuhiku 阅读(56) 评论(0) 推荐(0) 编辑
该文被密码保护。 阅读全文
posted @ 2022-02-16 06:14 bikuhiku 阅读(2) 评论(0) 推荐(0) 编辑
摘要: #include<stdio.h> #include<stack> #include<vector> #include<cstring> namespace bikuhiku { template <typename _T> _T gtr(_T &_compare_x,_T &_compare_y) 阅读全文
posted @ 2022-02-15 17:10 bikuhiku 阅读(23) 评论(0) 推荐(0) 编辑
摘要: D. 备用交换机 题目描述 n个城市之间有通讯网络,每个城市都有通讯交换机,直接或间接与其它城市连接。因电子设备容易损坏,需给通讯点配备备用交换机。但备用交换机数量有限,不能全部配备,只能给部分重要城市配置。于是规定:如果某个城市由于交换机损坏,不仅本城市通讯中断,还造成其它城市通讯中断,则配备备用 阅读全文
posted @ 2022-02-15 10:07 bikuhiku 阅读(28) 评论(0) 推荐(0) 编辑
摘要: $\color{black}{Tarjan}$是在$dfs$的过程中维护了一个栈,以及$low$(回溯值),$dfn$(时间戳)两个数组。 $low$和$dfn$的计算 $dfn$就在$dfs$的过程中打就可以了,而$low$的计算方式稍稍复杂一些: 1.如果$edge_{x,y}$为树枝边($y$ 阅读全文
posted @ 2022-02-15 07:12 bikuhiku 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 不得不讲,树是一道好题。 先介绍一下题目: 这道题里,求值和改点没有什么好说的,就是换根会很麻烦。 但是大家可以想想,在一个形状固定的树上,无论怎样改变根节点,欧拉序是不变的。 例如: 节点 | 子节点 | 1 | 2 3 | 2 | 4 5 | 3 | 6 | 这样的一棵树,以1为根节点的欧拉序是 阅读全文
posted @ 2022-02-14 12:06 bikuhiku 阅读(28) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int z = 1024; struct EDGE{ int t, next; int w; } edge[z*5]; int cnt, head[z]; void adedge(int f,int 阅读全文
posted @ 2022-02-12 21:45 bikuhiku 阅读(40) 评论(0) 推荐(0) 编辑
摘要: #include<bits/stdc++.h> using namespace std; const int z = 1e6+10; int minn[z][16]; int maxn[z][16]; int data[z]; void RMinQ_init(int &size) { for(int 阅读全文
posted @ 2022-02-12 17:13 bikuhiku 阅读(46) 评论(6) 推荐(1) 编辑
摘要: 有限值域平衡树 #include <stdio.h> #include <math.h> #include <string.h> #include <algorithm> enum { the_size = 100010 }; class BIT_TREE { private : int num[t 阅读全文
posted @ 2022-02-11 18:02 bikuhiku 阅读(54) 评论(0) 推荐(0) 编辑
摘要: 被考试题给整破防了,回来重修 QUESTION 1 : LIS 首先,不难想到: $$dp_i = \max\limits_{j = 1&a_i > a_j}^{i - 1}(dp_j+1)$$ const int N = 1024; int dp[N], pre[N]; int a[N], n; 阅读全文
posted @ 2022-02-11 06:42 bikuhiku 阅读(57) 评论(0) 推荐(0) 编辑