随笔分类 - 图论 lca
摘要:F. Auction of Services time limit per test 2.0 s memory limit per test 256 MB input standard input output standard output It is becoming more common t
阅读全文
摘要:2588: Spoj 10628. Count on a tree Description 给定一棵N个节点的树,每个点有一个权值,对于M个询问(u,v,k),你需要回答u xor lastans和v这两个节点间第K小的点权。其中lastans是上一个询问的答案,初始为0,即第一个询问的u是明文。
阅读全文
摘要:A - Breadth-First Search by Foxpower Problem Statement Fox Ciel went to JAG Kingdom by bicycle, but she forgot a place where she parked her bicycle. S
阅读全文
摘要:Connections between cities Time Limit: 10000/5000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description After World War X, a
阅读全文
摘要:Distance Queries Description Farmer John's cows refused to run in his marathon since he chose a path much too long for their leisurely lifestyle. He t
阅读全文
摘要:How far away ? Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Problem Description There are n houses in the village
阅读全文
摘要:1832: [AHOI2008]聚会 Description Y岛风景美丽宜人,气候温和,物产丰富。Y岛上有N个城市,有N-1条城市间的道路连接着它们。每一条道路都连接某两个城市。幸运的是,小可可通过这些道路可以走遍Y岛的所有城市。神奇的是,乘车经过每条道路所需要的费用都是一样的。小可可,小卡卡和小
阅读全文
摘要:Nearest Common Ancestors Description A rooted tree is a well-known data structure in computer science and engineering. An example is shown below: In t
阅读全文