DFS
xiao1guaishou
这个作者很懒,什么都没留下…
展开
-
PAT 1103 Integer Factorization
题目:The K−P factorization of a positive integer N is to write N as the sum of the P-th power of K positive integers. You are supposed to write a program to find the K−P factorization of N for any pos...原创 2019-07-04 20:53:44 · 129 阅读 · 0 评论 -
PAT A1094 The Largest Generation (25 分)
题目A family hierarchy is usually presented by a pedigree tree where all the nodes on the same level belong to the same generation. Your task is to find the generation with the largest population.Inp...原创 2019-07-25 21:40:25 · 97 阅读 · 0 评论 -
PAT A1062
题目A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Starting from one root supplier, everyone o...原创 2019-07-25 22:03:47 · 207 阅读 · 0 评论 -
PAT A1004 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 st...原创 2019-07-25 23:19:11 · 83 阅读 · 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 ...原创 2019-08-23 23:27:37 · 119 阅读 · 0 评论 -
PAT A1021 Deepest Root (25 分)
题目A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a highest tree. Such a r...原创 2019-08-25 23:50:21 · 144 阅读 · 0 评论