随笔分类 -  数据结构 树链剖分

摘要:Tree Problem Description You are given a tree (an acyclic undirected connected graph) with N nodes. The tree nodes are numbered from 1 to NThere are N 阅读全文
posted @ 2017-04-13 20:47 meekyan 阅读(454) 评论(0) 推荐(0)
摘要:Little Devil I Problem Description There is an old country and the king fell in love with a devil. The devil always asks the king to do some crazy thi 阅读全文
posted @ 2017-04-13 17:05 meekyan 阅读(335) 评论(0) 推荐(0)
摘要:Sometimes Naive Problem Description Rhason Cheung had a naive problem, and asked Teacher Mai for help. But Teacher Mai thought this problem was too si 阅读全文
posted @ 2017-04-10 20:17 meekyan 阅读(420) 评论(0) 推荐(0)
摘要:Dylans loves tree Problem Description Dylans is given a tree with N nodes.All nodes have a value A[i].Nodes on tree is numbered by 1∼N.Then he is give 阅读全文
posted @ 2017-04-10 15:01 meekyan 阅读(240) 评论(0) 推荐(0)
摘要:2243: [SDOI2011]染色 Description 给定一棵有n个节点的无根树和m个操作,操作有2类: 1、将节点a到节点b路径上所有点都染成颜色c; 2、询问节点a到节点b路径上的颜色段数量(连续相同颜色被认为是同一段),如“112221”由3段组成:“11”、“222”和“1”。 请你 阅读全文
posted @ 2017-04-10 14:02 meekyan 阅读(254) 评论(0) 推荐(0)
摘要:D. Happy Tree Party Bogdan has a birthday today and mom gave him a tree consisting of n vertecies. For every edge of the tree i, some number xi was wr 阅读全文
posted @ 2016-08-13 16:01 meekyan 阅读(291) 评论(0) 推荐(0)
摘要:Problem 2082 过路费 Problem Description 有n座城市,由n-1条路相连通,使得任意两座城市之间可达。每条路有过路费,要交过路费才能通过。每条路的过路费经常会更新,现问你,当前情况下,从城市a到城市b最少要花多少过路费。 Input 有多组样例,每组样例第一行输入两个正 阅读全文
posted @ 2016-08-13 12:14 meekyan 阅读(290) 评论(0) 推荐(0)
摘要:E. Minimum spanning tree for each edge E. Minimum spanning tree for each edge Connected undirected weighted graph without self-loops and multiple edge 阅读全文
posted @ 2016-08-12 15:41 meekyan 阅读(206) 评论(0) 推荐(0)
摘要:4034: [HAOI2015]T2 Description 有一棵点数为 N 的树,以点 1 为根,且树点有边权。然后有 M 个 操作,分为三种: 操作 1 :把某个节点 x 的点权增加 a 。 操作 2 :把某个节点 x 为根的子树中所有点的点权都增加 a 。 操作 3 :询问某个节点 x 到根 阅读全文
posted @ 2016-03-11 20:48 meekyan 阅读(217) 评论(0) 推荐(0)
摘要:Aragorn's Story Description Our protagonist is the handsome human prince Aragorn comes from The Lord of the Rings. One day Aragorn finds a lot of enem 阅读全文
posted @ 2016-03-05 12:10 meekyan 阅读(375) 评论(0) 推荐(0)
摘要:1036: [ZJOI2008]树的统计Count Description 一棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w。我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. QMAX u v: 询问从点u到点v的路径上的节点 阅读全文
posted @ 2016-03-02 17:36 meekyan 阅读(215) 评论(0) 推荐(0)
摘要:375. Query on a tree Problem code: QTREE You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. 阅读全文
posted @ 2016-02-27 17:25 meekyan 阅读(292) 评论(0) 推荐(0)