摘要:
题目:http://codeforces.com/problemset/problem/109/C 题意:一棵树n个节点,组成一个图,每条边都有权值,对于i、j、k三个数,计算所有的 i 到 j 和 i 到 k 的路径上有幸运数的三元组个数。 题解:用并查集来做,对于任意节点 i ,找出与 i 连通 阅读全文
摘要:
题目: Trouble came from the overseas lands: a three-headed dragon Gorynych arrived. The dragon settled at point C and began to terrorize the residents o 阅读全文
摘要:
Problem Description In the game of DotA, Pudge’s meat hook is actually the most horrible thing for most of the heroes. The hook is made up of several 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2795 Problem Description At the entrance to the university, there is a huge rectangular billboard of si 阅读全文
摘要:
Description Several currency exchange points are working in our city. Let us suppose that each point specializes in two particular currencies and perf 阅读全文
摘要:
题目:Tree Traversals Again An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-n 阅读全文
摘要:
Problem Description Jack likes to travel around the world, but he doesn’t like to wait. Now, he is traveling in the Undirected Kingdom. There are n ci 阅读全文