#include#include#include#include#include#include#include#include#include#include#include#includeusing namespace std;int father[10000];int getfather(in...
分类:
其他好文 时间:
2014-07-16 18:13:05
阅读次数:
187
#include #include #include #include #include #include #include #include #include #include #include #include using namespace std;int father[22222];int ...
分类:
其他好文 时间:
2014-07-16 18:06:16
阅读次数:
134
Description
Little John is herding his father's cattles. As a lazy boy, he cannot tolerate chasing the cattles all the time to avoid unnecessary omission. Luckily, he notice that there were N trees...
分类:
其他好文 时间:
2014-07-06 10:39:09
阅读次数:
188
binary search\sort\find operations
status InsertNode(Node* root, data x, Node* father)
{
if(root==NULL)
{
if(father==NULL)
Tree empty;
else
{
if(xdata)
{
father->left=new Node//inital l...
分类:
其他好文 时间:
2014-06-10 08:09:49
阅读次数:
234
子类在继承父类后,创建子类对象会首先调用父类的构造函数,先运行父类的构造函数,然后再运行子类的构造函数,例如以下所看到的:class
Father{ public Father(){ System.out.println("I am father"); }}public class Child
e....
分类:
编程语言 时间:
2014-06-09 19:22:33
阅读次数:
203
膜拜HZWER大牛的编码能力!附上他的代码(我的代码不知为何一直莫名出错……)#include#include#includeusing namespace
std;int tot,n,m,d,father[400001],head[400001],q[400001],ans[400001],cnt...
分类:
Web程序 时间:
2014-06-02 11:06:31
阅读次数:
306
public class Processer{ public virtual string
Test() { return "virtual"; } public string Test2() { return "father"; }}public
class Processer2 : Proces...
分类:
其他好文 时间:
2014-05-27 00:17:38
阅读次数:
278
父类引用指向子类对象从对象的内存角度来理解试试.假设现在有一个父类Father,它里面的变量需要占用1M内存.有一个它的子类Son,它里面的变量需要占用0.5M内存.现在通过代码来看看内存的分配情况:Father
f = new Father();//系统将分配1M内存.Son s = new So...
分类:
其他好文 时间:
2014-05-26 09:13:37
阅读次数:
180
题目链接:点击打开链接
题意:给定n个点 m个询问
下面n-1行给定一棵树
m个询问 x y
问把树转成以x为根 y的父节点是谁
第一种情况lca==y那就是x的第 dep[x] - dep[y] -1 父亲,依次向上爬山坡,利用倍增的二进制加速。
第二种就是Father[y];
#include"cstdio"
#include"iostream"
#include"queue"
...
分类:
其他好文 时间:
2014-05-15 09:11:44
阅读次数:
397
其实关键就是window.opener,这个东西就是如何在子窗口页面中,访问父窗口页面的文档的方法,在frame中,是parent、top这类的东西,知道了这个东西,剩下想做点什么就好说了。
父窗口操作子窗口的话,就利用open的返回值就可以了。 father.htm: 我是父页面。child.ht...
分类:
其他好文 时间:
2014-05-15 07:43:22
阅读次数:
232