![](https://img-blog.csdnimg.cn/20201014180756922.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
Doria_Lee
Danger is very real
But fear is a choice
展开
-
PAT A1154 2019.08.14 【自定义图判断 map】
1154Vertex Coloring(25分)Aproper vertex coloringis a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A coloring using at mostk...原创 2019-08-15 14:51:54 · 171 阅读 · 0 评论 -
PAT A1146 2019.08.24 【拓扑排序】
1146Topological Order(25分)This is a problem given in the Graduate Entrance Exam in 2018: Which of the following is NOT a topological order obtained from the given directed graph? Now you are supp...原创 2019-08-25 22:16:42 · 142 阅读 · 0 评论 -
PAT A1135 2019.08.20 【红黑树】
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-08-21 18:20:59 · 337 阅读 · 0 评论 -
PAT A1149 2019.08.16 【图】
1149Dangerous Goods Packaging(25分)When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same container, or we might get ourselves in serious trou...原创 2019-08-16 18:28:05 · 170 阅读 · 0 评论 -
PAT A1150 2019.08.16 【自定义图判断】
1150Travelling Salesman Problem(25分)The "travelling salesman problem" asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest poss...原创 2019-08-16 19:30:03 · 133 阅读 · 0 评论 -
PAT A1136 2019.08.26 【string】
1136A Delayed Palindrome(20分)Consider a positive integerNwritten in standard notation withk+1digitsaiasak⋯a1a0with0≤ai<10for alliandak>0. ThenNispalindromi...原创 2019-08-26 20:40:13 · 152 阅读 · 0 评论 -
PAT A1126 2019.08.28 【dfs 连通图】
1126Eulerian Path(25分)In graph theory, an Eulerian path is a path in a graph which visits every edge exactly once. Similarly, an Eulerian circuit is an Eulerian path which starts and ends on the ...原创 2019-08-28 21:26:40 · 174 阅读 · 0 评论 -
PAT A1125 2019.08.28 【vector sort】
1125Chain the Ropes(25分)Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by t...原创 2019-08-28 21:44:18 · 97 阅读 · 0 评论 -
PAT A1124 2019.08.28 【map】
1124Raffle for Weibo Followers(20分)John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for his followers on Weibo -- that is, he would select winners from every N fo...原创 2019-08-29 09:51:24 · 164 阅读 · 0 评论 -
PAT A1148 2019.08.16 【枚举】
1148Werewolf - Simple Version(20分)Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human beings. Suppose that in a game,player #1 said: "Pla...原创 2019-08-29 10:56:47 · 155 阅读 · 0 评论 -
PAT A1153 2019.08.14 【结构体sort map】
1153Decode Registration Card of PAT(25分)A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely,Tfor the top level,Afor advance andBfor basi...原创 2019-08-29 15:39:36 · 114 阅读 · 0 评论 -
PAT A1145 2019.08.24 【平方再探测】
1145Hashing - Average Search Time(25分)The task of this problem is simple: insert a sequence of distinct positive integers into a hash table first. Then try to find another sequence of integer key...原创 2019-08-25 22:13:27 · 180 阅读 · 1 评论 -
PAT A1144 2019.08.24 【水题】
1144The Missing Number(20分)Given N integers, you are supposed to find the smallest positive integer that is NOT in the given list.Input Specification:Each input file contains one test case. F...原创 2019-08-25 22:10:23 · 162 阅读 · 0 评论 -
PAT A1122 2019.08.11 【自定义图判断】
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-11 17:58:33 · 194 阅读 · 0 评论 -
PAT A1052 2019.08.14 【string】
1152Google Recruitment(20分)In July 2004, Google posted on a giant billboard along Highway 101 in Silicon Valley (shown in the picture below) for recruitment. The content is super-simple, a URL co...原创 2019-08-15 15:29:08 · 209 阅读 · 0 评论 -
PAT A1147 2019.08.12 【层序完全二叉树性质建树 堆 后序遍历】
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-12 16:40:30 · 205 阅读 · 0 评论 -
PAT A1128 2019.08.20 【水题】
1128N Queens Puzzle(20分)The "eight queens puzzle" is the problem of placing eight chess queens on an8×8chessboard so that no two queens threaten each other. Thus, a solution requires that no tw...原创 2019-08-21 14:01:30 · 123 阅读 · 0 评论 -
PAT A1130 2019.08.20 【DFS 中缀表达式】
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-08-21 15:06:28 · 241 阅读 · 0 评论 -
PAT A1140 2019.08.22 【string】
1140Look-and-say Sequence(20分)Look-and-say sequence is a sequence of integers as the following:D, D1, D111, D113, D11231, D112213111, ...whereDis in [0, 9] except 1. The (n+1)st number is...原创 2019-08-25 21:41:06 · 104 阅读 · 0 评论 -
PAT A1141 2019.08.22 【sort map string】
1141PAT Ranking of Institutions(25分)After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ranklist.In...原创 2019-08-25 21:51:11 · 80 阅读 · 0 评论 -
PAT A1142 2019.08.22 【自定义图判断】
1142Maximal Clique(25分)Acliqueis a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. Amaximal cliqueis a clique that cannot be extend...原创 2019-08-25 21:55:42 · 161 阅读 · 0 评论 -
PAT A1099 2019.08.22 【固定结构BST建树 层序遍历】
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-08-25 22:03:53 · 163 阅读 · 0 评论 -
PAT A1064 2019.08.24 【固定结构BST建树 层序遍历】
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-08-25 22:07:19 · 132 阅读 · 0 评论 -
2019.08.29 【并查集 set】
----Union Find----first line in input includes two positive integers N(node's index) M(the M lines follow)the later lines include A and B,means A&B is friendsuppose that A&B is frien...原创 2019-08-29 21:28:40 · 110 阅读 · 0 评论 -
PAT A1113 2019.08.30 【水题】
1113Integer Set Partition(25分)Given a set ofN(>1) positive integers, you are supposed to partition them into two disjoint setsA1andA2ofn1andn2numbers, respectively. LetS...原创 2019-08-30 19:23:01 · 145 阅读 · 0 评论 -
PAT A1112 2019.08.30 【map string】
1112Stucked Keyboard(20分)On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the characters corresponding to those keys will appear repeatedly on screen fo...原创 2019-08-30 20:11:28 · 91 阅读 · 0 评论 -
PAT A1116 2019.09.02 【map 简单逻辑】
1116Come on! Let's C(20分)"Let's C" is a popular and fun programming contest hosted by the College of Computer Science and Technology, Zhejiang University. Since the idea of the contest is for fun...原创 2019-09-02 15:34:40 · 197 阅读 · 0 评论 -
PAT Attention 2019.09.03
DEVC++开启 C++11原创 2019-09-03 10:14:18 · 221 阅读 · 0 评论 -
PAT A1120 2019.09.03 【set】
1120Friend Numbers(20分)Two integers are called "friend numbers" if they share the same sum of their digits, and the sum is their "friend ID". For example, 123 and 51 are friend numbers since 1+2+...原创 2019-09-03 10:17:30 · 114 阅读 · 0 评论 -
PAT A1121 2019.09.03 【set】
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-09-03 13:25:29 · 156 阅读 · 0 评论 -
PAT A1129 2019.09.04 【map】
1129Recommendation System(25分)Recommendation system predicts the preference that a user would give to an item. Now you are asked to program a very simple recommendation system that rates the user...原创 2019-09-04 11:57:49 · 127 阅读 · 0 评论 -
PAT A190302 2019.09.01 【图遍历】
7-3 Telefraud Detection 未作答 得分: 0 / 25Telefraud(电信诈骗) remains a common and persistent problem in our society. In some cases, unsuspecting victims lose their entire life savings. To stop this crime, ...原创 2019-09-04 20:39:23 · 229 阅读 · 0 评论 -
PAT A1123 2019.09.05 【AVL建树 层序判断完全二叉树】
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-09-05 14:14:37 · 287 阅读 · 0 评论 -
dijkstra 2019.09.06
dijkstra基本操作/*6个顶点 8条边 起点为00->1 权值为1下同6 8 00 1 10 3 40 4 41 3 22 5 13 2 23 4 34 5 3*/#include<cstdio>#include<iostream>#include<algorithm>#define MAX 10...原创 2019-09-06 00:41:15 · 129 阅读 · 0 评论 -
PAT A1003 2019.09.06 【dijkstra 点权 最短路径条数】
1003Emergency(25分)As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities connected by some roads. Amount of rescue teams...原创 2019-09-06 13:25:19 · 235 阅读 · 0 评论 -
PAT A1100 2019.09.06 【map 字符串处理】
1100Mars 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...原创 2019-09-06 16:04:47 · 189 阅读 · 0 评论 -
PAT A190301 2019.09.01 【素数】
7-1Sexy Primes(20分)Sexy primes are pairs of primes of the form (p,p+6), so-named since "sex" is the Latin word for "six". (Quoted fromhttp://mathworld.wolfram.com/SexyPrimes.html)Now given an...原创 2019-09-02 14:15:12 · 179 阅读 · 0 评论 -
PAT A190302 2019.09.01 【结构体sort map】
7-2Anniversary(25分)Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered the ID's of all her alumni. N...原创 2019-09-02 14:05:43 · 136 阅读 · 0 评论 -
PAT A1107 2019.08.30 【并查集】
1107Social Clusters(30分)When register on a social network, you are always asked to specify your hobbies in order to find some potential friends with the same hobbies. Asocial clusteris a set of...原创 2019-08-30 21:24:10 · 123 阅读 · 0 评论 -
PAT A1118 2019.08.31 【并查集】
1118Birds in Forest(25分)Some scientists took pictures of thousands of birds in a forest. Assume that all the birds appear in the same picture belong to the same tree. You are supposed to help the...原创 2019-08-31 13:59:17 · 191 阅读 · 0 评论