2020年4月17日
摘要: #include<iostream> #include<cstdio> #include<queue> #include<cstring> #include<algorithm> typedef long long LL; using namespace std; LL RD(){ LL out = 阅读全文
posted @ 2020-04-17 22:57 mmn 阅读(146) 评论(0) 推荐(0) 编辑
摘要: dfs序就是一棵树在dfs遍历时组成的节点序列.(先序遍历差不多),dfs序把一棵树进行区间化 出入的区间就是它掌控的子树,出入分别即为in[x],out[x],in[x]为结点x进入时的时间戳,out[x]为结点x出去时的时间戳 比如上图子树,dfs序为,A B E E F K K F B C G 阅读全文
posted @ 2020-04-17 22:56 mmn 阅读(253) 评论(0) 推荐(0) 编辑
摘要: 链接:https://codeforces.com/contest/765/problem/D 题意;给n个数,分别是f(i),让你找n个g(i)和m(任意)个h(i), 其中,g(h(x))=x,h(g(x))=f(x); 题解:推一下这个式子,可得到h(x)=f(h(x)),g(x)=g(f(x 阅读全文
posted @ 2020-04-17 21:48 mmn 阅读(93) 评论(0) 推荐(0) 编辑