看nginx代码时发现双链表使用的是这种方法,记录一下 给出一个实例来说明 struct father_t { int a; char *b; double c;}f;char *ptr = &(f.b);//而不是 ptr = f.b; 这里ptr是b的地址,而不是它指向的地址。 struct f ...
分类:
编程语言 时间:
2019-09-11 11:43:58
阅读次数:
225
分析 有没有很像银河英雄传说? 好吧没有 问题不一样,不过换汤不换药 先看问题:在当前这个时候,i号陨石在所在区域x、x区域共有的陨石数y、以及i号陨石被搬运的次数z。 这个,在并查集的merge与find中维护就好,相当于变相的树形DP啦 注意这一句: 首先,必需在father更新完后在更新儿子 ...
分类:
其他好文 时间:
2019-09-03 19:28:14
阅读次数:
110
<div id="father"> <footer></footer> </div> #father{ position:relative; //父元素加入相对定位 不加则固定到html底部 } footer { position: absolute; //绝对定位 bottom: 0; left: ...
分类:
Web程序 时间:
2019-09-02 12:09:46
阅读次数:
122
思路:动态点分治 提交:3次 错因:在加点的时候堆的操作错误。 题解: 为什么有时候说点分治是一种数据结构呢?我觉得是因为点分治的核心是在分治过程中产生的树形结构,即点分树,它的深度是 $\log$ 级别的。 对于这道题,我们首先要建立出来点分树(只记father),每个点维护所有孩子的答案。当修改 ...
分类:
其他好文 时间:
2019-08-31 10:52:07
阅读次数:
68
组件的通信 1. 父子组件通信 案例:<!--StartFragment--> //父子组件通信思路 // 1 将父组件的数据传给子组件 在子组件上自定义单项数据绑定 // 2 子组件用props 接受自定义的那个:号属性 Vue.component('father',{ template:'#fa ...
分类:
其他好文 时间:
2019-08-26 22:48:46
阅读次数:
99
<div class="div1"> father <div class="div2">son</div> </div> <style> .div1{ width: 200px; height: 200px; background-color: lightblue; } .div2{ width: ...
分类:
其他好文 时间:
2019-08-24 22:28:37
阅读次数:
62
function array2tree($data, $pId) { $tree = array(); foreach($data as $k => $v) { if ($v['father_id'] == $pId) { $v['child'] = array2tree($data, $v['or ...
分类:
其他好文 时间:
2019-08-19 17:26:42
阅读次数:
54
如果是学习的话,可以看一下这篇博客 LCT有一点类似于树链剖分,只不过是实链和虚链,然后可以不断变化。每一条实链用一个splay(深度为关键字)维护,splay还原出来就应该是一条由浅到深的链。 Splay的根的father是原树中链顶的父节点。特别的,原树根所在的Splay根节点的father为空 ...
分类:
其他好文 时间:
2019-07-25 19:10:56
阅读次数:
116
树链剖分 #include <algorithm>#include <cstdio>#include <vector>usingnamespacestd; constint maxn = 100000 + 10; int n,m,r,p,dis[maxn],dep[maxn],father[maxn ...
分类:
其他好文 时间:
2019-07-24 12:58:19
阅读次数:
89
创建完子进程后,主进程所在的这个脚本就退出了,当父进程先于子进程结束时,子进程会被init收养,成为孤儿进程,而非僵尸进程 import os import sys import time pid = os.getpid() ppid = os.getppid() print 'im father' ...
分类:
系统相关 时间:
2019-07-24 10:20:18
阅读次数:
119