随笔分类 -  LCA

摘要:1602: [Usaco2008 Oct]牧场行走Time Limit: 5 Sec Memory Limit: 64 MBDescription N头牛(2#include#includeusing namespace std;int n,Q,D... 阅读全文
posted @ 2018-05-14 18:27 XSamsara 阅读(193) 评论(0) 推荐(0)
摘要:3732: NetworkTime Limit: 10 Sec Memory Limit: 128 MBDescription 给你N个点的无向图 (1 #include#define MAXN 15005using namespace std;struct xc... 阅读全文
posted @ 2018-04-10 11:13 XSamsara 阅读(161) 评论(0) 推荐(0)
摘要:1787: [Ahoi2008]Meet 紧急集合Time Limit: 20 Sec Memory Limit: 162 MBDescription Input Output Sample Input 6 4 1 2 2 3 2 4 ... 阅读全文
posted @ 2018-01-14 20:49 XSamsara 阅读(126) 评论(0) 推荐(0)
摘要:LCA(离线Tarjan算法,在线倍增法)详解首先我们看一道洛谷上的板子题:P3379 【模板】最近公共祖先(LCA)时空限制:1000ms,128M【题目描述】 如题,给定一棵有根多叉树,请求出指定两个点直接最近的公共祖先。【输入格式】 第一行包含三个正整数N、... 阅读全文
posted @ 2017-12-28 11:08 XSamsara 阅读(360) 评论(0) 推荐(0)