Description给出一个n个节点的有根树(编号为0到n-1,根节点为0)。一个点的深度定义为这个节点到根的距离+1。设dep[i]表示点i的深度,LCA(i,j)表示i与j的最近公共祖先。有q次询问,每次询问给出l r z,求sigma_{l 2 #include 3 #include ...
分类:
其他好文 时间:
2016-01-14 20:46:06
阅读次数:
219
对于一个盘子(dep[u]中,当且仅当 ①lca(u,v)==u时 设w为u的是v的祖先的儿子,则 1 2 using namespace std; 3 #define maxn 40005 4 #define maxt 32000005 5 6 int c...
分类:
其他好文 时间:
2016-01-03 19:35:26
阅读次数:
219
新装WIN7系统出现 .NET组建没有安装 可到官网下载安装 NETFx4.0运行MVB 上位机SIM.EXE出现应用程序已停止工作问题 解决办法:需关闭WIN7 DEP 如下开始-运行(以管理员身份运行)--bcdedit.exe /set nx alwaysoff
public class TreeLevel { public ListNode getTreeLevel(TreeNode root, int dep) { // write code here List result = new ArrayList(); ...
分类:
其他好文 时间:
2015-12-22 21:26:15
阅读次数:
244
//也就是把高度在递归过程中给一并算了。public class Balance { public static boolean checkBalance(TreeNode root, int[] dep){//java 里没有传地址if(null == root){dep[0] = 0;re...
分类:
其他好文 时间:
2015-12-22 14:34:10
阅读次数:
167
Could not load file or assembly 'MySql.Data.CF, Version=6.4.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, Retargetable=Yes' or one of its dep...
分类:
数据库 时间:
2015-12-21 15:32:51
阅读次数:
267
sudo -sapt-get source nginxapt-get build-dep nginxwget 'https://github.com/agentzh/chunkin-nginx-module/tarball/v0.23rc2'tar -xzvf v0.23rc2#rename dir...
分类:
其他好文 时间:
2015-12-17 10:52:23
阅读次数:
200
一、Ubuntu中软件安装方法1、APT方式(1)普通安装:apt-get install softname1 softname2 …;(2)修复安装:apt-get -f install softname1 softname2... ;(-f Atemp to correct broken dep...
分类:
系统相关 时间:
2015-12-16 00:07:27
阅读次数:
244
1.从libc中找到"/bin/sh"的地址(gdb)find__libc_start_main,length,"/bin/sh"2.安排缓冲区'a'*length+addressOfSystem+addressOfExit+addressOfBinSh3.PLT & GOT延迟绑定:PLT第一次调...
分类:
其他好文 时间:
2015-12-14 01:14:41
阅读次数:
263
如:select distinct dep_id from t_sys_dep_dimensions start with dep_id = (select dept_id from t_sys_person where mdm_user_id='#userId#') connect by nocy...
分类:
其他好文 时间:
2015-12-11 16:36:39
阅读次数:
123