随笔分类 - zyq's模板库
begin 2014/6/0
摘要:题意:给出一颗树,求出两个点的距离小于K的点对的个数.sL : 树的点分治,代码中有解释。1#include2#include3#include4#include5#include6#include7usingnamespacestd;8typedeflonglongLL;9constintMAX=...
阅读全文
摘要:http://poj.org/problem?id=1330题意:给出一个图,求两个点的最近公共祖先。sl :水题,贴个模板试试代码。本来是再敲HDU4757的中间发现要用LCA, 操蛋只好用这个题目试试自己写的对不对。 下面是个倍增的写法,挺实用的。好了,继续。。。1#include2#inclu...
阅读全文
摘要:1/******************2byzhuyuqi*3QQ:1113865149*4name:2-sat*5*6******************/78usingnamespacestd;9constintMAX=1000;10intr[MAX],*rank;11intwa[MAX],w...
阅读全文