最近公共祖先LCA
mengxiang000000
这个作者很懒,什么都没留下…
展开
-
POJ 1986 Distance Queries【LCA】
Distance QueriesTime Limit: 2000MS Memory Limit: 30000KTotal Submissions: 11677 Accepted: 4124Case Time Limit: 1000MSDescriptionFarmer原创 2016-05-17 17:41:54 · 543 阅读 · 0 评论 -
POJ 1330 Nearest Common Ancestors【LCA】
Nearest Common AncestorsTime Limit: 1000MS Memory Limit: 10000KTotal Submissions: 24210 Accepted: 12605DescriptionA rooted tree is a well-known原创 2016-05-17 16:02:15 · 332 阅读 · 0 评论 -
hdu 2586 How far away ?【LCA】
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 11322 Accepted Submission(s): 4121Problem DescriptionThere are n ho原创 2016-05-18 12:43:35 · 529 阅读 · 0 评论 -
codeforces #362(Div.2)C.Lorenzo Von Matterhorn【最近公祖先相关】
C. Lorenzo Von Matterhorntime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputBarney lives in NYC. NYC has infin原创 2016-07-15 10:45:27 · 386 阅读 · 0 评论 -
第十五届北京师范大学程序设计竞赛决赛 B. Borrow Classroom【思维+LCA】好题~
B. Borrow ClassroomTime Limit: 5000msMemory Limit: 262144KB64-bit integer IO format: %lld Java class name: MainSubmit Status PID: 52509每年的BNU校赛都会有两次赛前培训,为此就需要去借教室,由于SK原创 2017-04-23 17:39:23 · 569 阅读 · 0 评论 -
【大二最后两题】Hrbust 2064 萌萌哒十五酱的宠物~【思维+树链剖分 / 树上倍增LCA】
萌萌哒十五酱的宠物~Time Limit: 2000 MSMemory Limit: 32768 KTotal Submit: 43(15 users)Total Accepted: 19(13 users)Rating: Special Judge: NoDescription原创 2017-08-27 18:44:33 · 451 阅读 · 0 评论 -
Hdu 2586 How far away ?【倍增LCA模板记录】
How far away ?Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 17529 Accepted Submission(s): 6789Problem DescriptionThere are原创 2017-08-25 13:49:38 · 290 阅读 · 0 评论 -
Codeforces 832D Misha, Grisha and Underground【LCA】
D. Misha, Grisha and Undergroundtime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputMisha and Grisha are funny boys, so原创 2017-08-28 15:43:23 · 303 阅读 · 0 评论 -
Gym 101142G Gangsters in Central City【思维+Lca】
题目大意:给出N个点的一棵树,有Q次操作,任何操作和查询都是对于叶子节点来说的。每一次操作:+ v表示点v来了盗贼,- v表示点v的盗贼走了,我们的根节点是1,和根节点1相连接的点都有水源,否则就没有了水源。每次操作之后,查询:用最少的边数去切割树边,使得所有盗贼所在的点都没有水,于此同时,希望割除的方案使得无辜的城市的个数最少。问最少边数和最少无辜城市的个数。原创 2017-10-03 17:27:30 · 512 阅读 · 0 评论