- 博客(64)
- 资源 (1)
- 收藏
- 关注
原创 PAT-甲级-题解目录
甲级题目目录编号 题目 分数 类型 日期 1004 Counting Leaves 30 树的遍历→保存每层叶子节点数 19-07-18 1053 Path of Equal Weight 30 19-07-24 1079 Total Sales of Supply Chain 25 ...
2019-07-16 21:27:30 302
原创 PAT-甲级-1139 First Contact (30 分)
1139First Contact(30分)#include <iostream>#include <string>#include <vector>#include <unordered_map>#include <set>#include <algorithm>using namespace std...
2019-08-29 08:25:51 253
原创 PAT-甲级-1131 Subway Map (30 分)
1131Subway Map(30分)#include <iostream>#include <string>#include <vector>#include <unordered_map>#include <set>#include <algorithm>#include <cmath>...
2019-08-27 18:48:27 180
原创 PAT-甲级-1122 Hamiltonian Cycle (25 分)
1122Hamiltonian Cycle(25分)#include <iostream>#include <set>using namespace std;#define rep(i,j,k) for(int i=j;i<k;i++)int v[210][210];int main(){ std::ios::sync_with_...
2019-08-27 18:45:06 128
原创 PAT-甲级-1118 Birds in Forest (25 分)
1118Birds in Forest(25分)#include <iostream>#include <string>#include <vector>#include <set>#include <map>#include <queue>#define rep(i,j,k) for(int i...
2019-08-27 18:43:51 132
原创 PAT-甲级-1114 Family Property (25 分)
1114Family Property(25分)#include <iostream>#include <string>#include <vector>#include <map>#include <set>#include <queue>#include <stack>#include...
2019-08-27 18:42:35 134
原创 PAT-甲级-1076 Forwards on Weibo (30 分)
1076Forwards on Weibo(30分)#include <iostream>#include <string>#include <vector>#include <map>#include <set>#include <algorithm>#include <queue>#d...
2019-08-27 18:40:07 132
原创 PAT-甲级-1072 Gas Station (30 分)
1072Gas Station(30分)#include <iostream>#include <string>#include <map>#include <set>#include <algorithm>#define rep(i,j,k) for(int i=j;i<k;i++)using nam...
2019-08-27 18:38:12 133
原创 PAT-甲级-1034 Head of a Gang (30 分)
1034Head of a Gang(30分)One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call betweenAandB, we say thatAandBis related. The weight of a...
2019-08-27 18:35:32 125
原创 PAT-甲级-1121 Damn Single (25 分)
1121Damn Single(25分)"Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to find those who are alone in a big party, so they can be taken care of.Input ...
2019-08-17 20:51:50 97
原创 PAT-甲级-1122 Hamiltonian Cycle (25 分)
1122Hamiltonian Cycle(25分)The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle".In this problem, you are sup...
2019-08-17 20:46:20 157
原创 PAT-甲级-1100 Mars Numbers (20 分)
People on Mars count their numbers with base 13:Zero on Earth is called "tret" on Mars. The numbers 1 to 12 on Earth is called "jan, feb, mar, apr, may, jun, jly, aug, sep, oct, nov, dec" on Mars, ...
2019-08-14 22:39:51 110
原创 PAT-甲级-1034 Head of a Gang (30 分)
1034Head of a Gang(30分)One way that the police finds the head of a gang is to check people's phone calls. If there is a phone call betweenAandB, we say thatAandBis related. The weight of a...
2019-08-05 21:35:40 94
原创 PAT-甲级-1111 Online Map (30 分)
1111Online Map(30分)Input our current position and a destination, an online map can recommend several paths. Now your job is to recommend two paths to your user: one is the shortest, and the other...
2019-08-03 21:58:47 234
原创 PAT-甲级-1087 All Roads Lead to Rome (30 分)
1087All 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 hap...
2019-08-03 21:57:32 201
原创 PAT-甲级-1030 Travel Plan (30 分)
1030Travel Plan(30分)A traveler's map gives the distances between cities along the highways, together with the cost of each highway. Now you are supposed to write a program to help a traveler to d...
2019-08-03 21:55:41 185
原创 PAT-甲级-1018 Public Bike Management (30 分)
1018Public Bike Management(30分)There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the world. One may rent a bike at any station and ret...
2019-08-03 21:50:34 183
原创 PAT-甲级-1021 Deepest Root (25 分)
1021Deepest 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 ...
2019-08-02 21:32:32 136
原创 PAT-甲级-1020 Tree Traversals (25 分)
1020Tree Traversals(25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order ...
2019-08-02 21:01:17 107
原创 PAT-甲级-1155 Heap Paths (30 分)
1155Heap Paths(30分)In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either gre...
2019-08-01 21:29:45 119
原创 PAT-甲级-1147 Heaps (30 分)
1147Heaps(30分)In computer science, aheapis a specialized tree-based data structure that satisfies the heap property: if P is a parent node of C, then the key (the value) of P is either greater ...
2019-08-01 20:37:33 118
原创 PAT-甲级-1135 Is It A Red-Black Tree (30 分)
1135Is It A Red-Black Tree(30分)There is a kind of balanced binary search tree namedred-black treein the data structure. It has the following 5 properties:(1) Every node is either red or black...
2019-07-31 21:33:17 129
原创 PAT-甲级-1123 Is It a Complete AVL Tree (30 分)
1123Is It a Complete AVL Tree(30分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they ...
2019-07-31 20:49:47 160
原创 PAT-甲级-1066 Root of AVL Tree (25 分)
1066Root of AVL Tree(25分)An AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by at most one; if at any time they differ by...
2019-07-30 22:01:33 163
原创 PAT-甲级-1151 LCA in a Binary Tree (30 分)
1151LCA in a Binary Tree(30分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.Given any two nodes in a binary tree, you a...
2019-07-30 21:28:33 154
原创 PAT-甲级-1143 Lowest Common Ancestor (30 分)
1143Lowest Common Ancestor(30分)The lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U and V as descendants.A binary search tree (BST) is recursively...
2019-07-30 20:02:11 131
原创 PAT-甲级-1114 Family Property (25 分)
1114Family Property(25分)This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we ne...
2019-07-30 19:58:45 124
原创 PAT-甲级-1138 Postorder Traversal (25 分)
1138Postorder Traversal(25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the preorder and inorder traversal sequences, you are supposed to output the first num...
2019-07-29 21:31:55 114
原创 PAT-甲级-1130 Infix Expression(25分)
1130Infix Expression(25分)Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specific...
2019-07-29 21:27:05 114
原创 PAT-甲级-1127 ZigZagging on a Tree (30 分)
1127ZigZagging 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 s...
2019-07-29 20:12:39 178
原创 PAT-甲级-1110 Complete Binary Tree (25 分)
1110Complete Binary Tree(25分)Given a tree, you are supposed to tell if it is a complete binary tree.Input Specification:Each input file contains one test case. For each case, the first line g...
2019-07-28 21:31:34 152
原创 PAT-甲级-1099 Build A Binary Search Tree (30 分)
1099Build A Binary Search Tree(30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys...
2019-07-28 21:02:13 212
原创 PAT-甲级-1064 Complete Binary Search Tree (30 分)
1064Complete Binary Search Tree(30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with key...
2019-07-27 22:00:57 129
原创 PAT-甲级-1043 Is It a Binary Search Tree (25 分)
1043Is It a Binary Search Tree(25分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys...
2019-07-27 21:55:56 128
原创 PAT-甲级-1090 Highest Price in Supply Chain (25 分)
1090 Highest Price in Supply Chain (25 分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Star...
2019-07-27 21:53:38 168
原创 PAT-甲级-1115 Counting Nodes in a BST (30 分)
1115Counting Nodes in a BST(30分)A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties:The left subtree of a node contains only nodes with keys le...
2019-07-27 20:37:23 132
原创 PAT-甲级-1106 Lowest Price in Supply Chain (25 分)
1106Lowest Price in Supply Chain(25分)A supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyone involved in moving a product from supplier to customer.Start...
2019-07-26 22:26:09 137
原创 PAT-甲级-1102 Invert a Binary Tree (25 分)
1102Invert a Binary Tree(25分)The following is from Max Howell @twitter:Google: 90% of our engineers use the software you wrote (Homebrew), but you can't invert a binary tree on a whiteboard ...
2019-07-26 21:17:41 170
原创 PAT-甲级-1094 The Largest Generation (25 分)
1094The 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 generatio...
2019-07-26 20:15:35 129
Unpaired Image-to-Image Translation using Adversarial Consistency Loss.pdf
2020-03-27
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人