
DFS
文章平均质量分 79
DrinkM1lk
这个作者很懒,什么都没留下…
展开
-
PAT甲级 1103 Integer Factorization(30分)
PAT甲级题解原创 2022-08-11 09:33:46 · 137 阅读 · 0 评论 -
PAT甲级 1127 ZigZagging on a Tree (30 分)
Suppose that all the keys in a binary tree are distinct positive integers. A unique binary tree can be determined by a given pair of postorder and inorder traversal sequences. And it is a simple standard routine to print the numbers in level-order. However原创 2021-09-08 21:14:04 · 175 阅读 · 0 评论 -
PAT甲级 1087 All Roads Lead to Rome (30 分)
Indeed there are many different tourist routes from our city to Rome. You are supposed to find your clients the route with the least cost while gaining the most happiness. Input Specification: Each input file contains one test case. For each case, the fi原创 2021-09-04 19:26:39 · 442 阅读 · 0 评论 -
PAT甲级 1013 Battle Over Cities (25 分)
It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We must know immediately if we need to repair any other highways to keep the rest of the c原创 2021-09-01 19:39:21 · 95 阅读 · 0 评论 -
PAT甲级 1004 Counting Leaves (30 分)
A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child. Input Specification: Each input file contains one test case. Each case starts with a line containing 0<N<100, the number of nod原创 2021-08-31 20:07:04 · 102 阅读 · 0 评论