2013年9月5日

POJ 2104 && POJ 2761 (静态区间第k大,主席树)

摘要: 查询区间第K大,而且没有修改。使用划分树是可以做的。作为主席树的入门题,感觉太神奇了,Orz 1 /* *********************************************** 2 Author :kuangbin 3 Created Time :2013-9-4 20:13:20 4 File Name :POJ2104.cpp 5 ************************************************ */ 6 7 #include 8 #include 9 #include 10 #incl... 阅读全文

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

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) 编辑

导航

JAVASCRIPT: