上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 94 下一页

2013年9月5日

POJ 1330 Nearest Common Ancestors (LCA,倍增算法,在线算法)

摘要: 1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-5 9:45:17 4 File Name :F:\2013ACM练习\专题学习\LCA\POJ1330_3.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #include 11 #include 12 #i... 阅读全文

posted @ 2013-09-05 10:22 kuangbin 阅读(2329) 评论(0) 推荐(0) 编辑

POJ 1470 Closest Common Ancestors (LCA,离线Tarjan算法)

摘要: Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13372Accepted:4340DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com 阅读全文

posted @ 2013-09-05 09:34 kuangbin 阅读(1671) 评论(0) 推荐(0) 编辑

POJ 1470 Closest Common Ancestors (LCA, dfs+ST在线算法)

摘要: Closest Common AncestorsTime Limit:2000MSMemory Limit:10000KTotal Submissions:13370Accepted:4338DescriptionWrite a program that takes as input a rooted tree and a list of pairs of vertices. For each pair (u,v) the program determines the closest common ancestor of u and v in the tree. The closest com 阅读全文

posted @ 2013-09-05 09:03 kuangbin 阅读(627) 评论(0) 推荐(0) 编辑

POJ 1330 Nearest Common Ancestors (LCA,dfs+ST在线算法)

摘要: Nearest Common AncestorsTime Limit:1000MSMemory Limit:10000KTotal Submissions:14902Accepted:7963DescriptionA rooted tree is a well-known data structure in computer science and engineering. An example is shown below:In the figure, each node is labeled with an integer from {1, 2,...,16}. Node 8 is the 阅读全文

posted @ 2013-09-05 08:42 kuangbin 阅读(1149) 评论(0) 推荐(0) 编辑

2013年9月4日

BZOJ 2002: [Hnoi2010]Bounce 弹飞绵羊 (动态树LCT)

摘要: 2002: [Hnoi2010]Bounce 弹飞绵羊Time Limit:10 SecMemory Limit:259 MBSubmit:2843Solved:1519[Submit][Status]Description某天,Lostmonkey发明了一种超级弹力装置,为了在他的绵羊朋友面前显摆,他邀请小绵羊一起玩个游戏。游戏一开始,Lostmonkey在地上沿着一条直线摆上n个装置,每个装置设定初始弹力系数ki,当绵羊达到第i个装置时,它会往后弹ki步,达到第i+ki个装置,若不存在第i+ki个装置,则绵羊被弹飞。绵羊想知道当它从第i个装置起步时,被弹几次后会被弹飞。为了使得游戏更有趣, 阅读全文

posted @ 2013-09-04 08:28 kuangbin 阅读(2982) 评论(0) 推荐(1) 编辑

HDU 4010 Query on The Trees (动态树)

摘要: Query on The TreesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 1527Accepted Submission(s): 747Problem DescriptionWe have met so many problems on the tree, so today we will have a query problem on a set of trees.There are N nodes, each node will 阅读全文

posted @ 2013-09-04 01:43 kuangbin 阅读(2575) 评论(10) 推荐(0) 编辑

SPOJ 375. Query on a tree (动态树)

摘要: 375. Query on a treeProblem code: QTREEYou are given a tree (an acyclic undirected connected graph) withNnodes, and edges numbered 1, 2, 3...N-1.We will ask you to perfrom some instructions of the following form:CHANGE i ti: change the cost of the i-th edge to tiorQUERY a b: ask for the maximum edge 阅读全文

posted @ 2013-09-04 00:10 kuangbin 阅读(1611) 评论(0) 推荐(0) 编辑

2013年9月3日

BZOJ 2049: [Sdoi2008]Cave 洞穴勘测 (动态树入门)

摘要: 2049: [Sdoi2008]Cave 洞穴勘测Time Limit:10 SecMemory Limit:259 MBSubmit:1528Solved:644[Submit][Status]Description辉辉热衷于洞穴勘测。某天,他按照地图来到了一片被标记为JSZX的洞穴群地区。经过初步勘测,辉辉发现这片区域由n个洞穴(分别编号为1到n)以及若干通道组成,并且每条通道连接了恰好两个洞穴。假如两个洞穴可以通过一条或者多条通道按一定顺序连接起来,那么这两个洞穴就是连通的,按顺序连接在一起的这些通道则被称之为这两个洞穴之间的一条路径。洞穴都十分坚固无法破坏,然而通道不太稳定,时常因为外 阅读全文

posted @ 2013-09-03 23:32 kuangbin 阅读(2973) 评论(0) 推荐(1) 编辑

2013年8月30日

HDU 3726 Graph and Queries (离线处理+splay tree)

摘要: Graph and QueriesTime Limit: 10000/5000 MS (Java/Others)Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 1467Accepted Submission(s): 301Problem DescriptionYou are given an undirected graph with N vertexes and M edges. Every vertex in this graph has an integer value assigned to it at the 阅读全文

posted @ 2013-08-30 19:31 kuangbin 阅读(1643) 评论(0) 推荐(0) 编辑

2013年8月28日

POJ 3580 SuperMemo (splay tree)

摘要: SuperMemoTime Limit:5000MSMemory Limit:65536KTotal Submissions:6841Accepted:2268Case Time Limit:2000MSDescriptionYour friend, Jackson is invited to a TV show called SuperMemo in which the participant is told to play a memorizing game. At first, the host tells the participant a sequence of numbers, { 阅读全文

posted @ 2013-08-28 21:30 kuangbin 阅读(980) 评论(0) 推荐(0) 编辑

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 94 下一页

导航

JAVASCRIPT: