摘要:
"题目链接" 题目描述 Hja有一棵N个点的树,树上每个点有点权,每条边有颜色。 一条路径的权值是这条路径上所有点的点权和,一条合法的路径需要满足该路径上任意相邻的两条边颜色都不相同。 问这棵树上所有合法路径的权值和是多少。 输入 第一行一个数N。 接下来一行N个数代表每个点的权值。 接下来N−1行 阅读全文
摘要:
真二叉树重构(Proper Rebuild) Description In general, given the preorder traversal sequence and postorder traversal sequence of a binary tree, we cannot dete 阅读全文
摘要:
重名剔除(Deduplicate) Description Mr. Epicure is compiling an encyclopedia of food. He had collected a long list of candidates nominated by several belly 阅读全文
摘要:
祖玛(Zuma) Description Let's play the game Zuma! There are a sequence of beads on a track at the right beginning. All the beads are colored but no three 阅读全文
摘要:
循环移位(Cycle) Description Cycle shifting refers to following operation on the sting. Moving first letter to the end and keeping rest part of the string. 阅读全文
摘要:
无线广播(Broadcast) Description A broadcaster wants to set up a radio broadcast transmitter in an area. There are n towns in the area, and each town has a 阅读全文
摘要:
玩具(Toy) Description ZC God is best at logical reasoning. One day, he talks about his childhood digital toys. The toy is like a Rubik's cube, but not a 阅读全文
摘要:
旅行商(TSP) Description Shrek is a postman working in the mountain, whose routine work is sending mail to n villages. Unfortunately, road between village 阅读全文
摘要:
平均气温(Temperature) Description A weather station collects temperature data from observation stations all over the country every day, and provides stati 阅读全文
摘要:
任务调度(Schedule) Description A HPS cluster is equipped with a unique task scheduler. To be simple, it is assumed that this cluster doesn’t support multi 阅读全文