自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(157)
  • 收藏
  • 关注

原创 PAT甲级题解目录(按序号排序)(Github地址已更新)

PAT甲级题解目录(按序号排序) 序号 题目 题目内容及题解 考察点 A1001 A+B Format (20 分) 题目内容及题解 字符串处理 A1002 A+B for Polynomials (25 分) 题目内容及题解 简单模拟 A1003 Emergency (25 分) 题目内容及题解 最短路径 ...

2019-02-01 12:01:07 4673

原创 普通人跨考浙大计算机的经验贴(2019)

目录写在前面个人概况初试数学专业课数据结构组原和OS网络英语政治复试机试面试总结先说说我的基本情况:我经历自认算是比较曲折。我2016年就本科毕业了,专业土木工程,与计算机几乎毫无交集(这点毫无夸张,我本科期间计算机公共课学的是VB),毕业后才下定决心转专业,但是因为一些原因从毕业后一直没能正式着手,直到2017年8月才开始第一次备考...

2019-03-20 17:36:40 23368 9

原创 PAT-A1155 Heap Paths 题目内容及题解

In computer science, a heap is 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 than or equal to (i...

2019-02-13 08:44:37 618

原创 PAT-A1154 Vertex Coloring 题目内容及题解

A proper vertex coloring is 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 most k colors is called a (proper) k...

2019-02-13 08:44:04 935

原创 PAT-A1153/B1095 Decode Registration Card of PAT/解码PAT准考证 题目内容及题解

A registration card number of PAT consists of 4 parts:the 1st letter represents the test level, namely, T for the top level, A for advance and B for basic; the 2nd - 4th digits are the test site nu...

2019-02-13 08:43:19 786

原创 PAT-A1152/B1094 Google Recruitment/谷歌的招聘 题目内容及题解

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 consisting of the first 10-digit p...

2019-02-13 08:42:23 672

原创 PAT-A1151 LCA in a Binary Tree 题目内容及题解

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 are supposed to find their LCA.In...

2019-02-13 08:41:35 481

原创 PAT-A1150 Travelling Salesman Problem 题目内容及题解

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 possible route that visits each city and retu...

2019-02-12 09:12:19 447

原创 PAT-A1149/B1090 Dangerous Goods Packaging/危险品装箱 题目内容及题解

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 trouble. For example, oxidizing agent (氧化剂)...

2019-02-12 09:11:43 726

原创 PAT-A1148/B1089 Werewolf - Simple Version/狼人杀-简单版 题目内容及题解

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: "Player #2 is a werewolf."; player #2 said...

2019-02-12 09:11:18 1349

原创 PAT-A1147 Heaps 题目内容及题解

In computer science, a heap is 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 than or equal to (i...

2019-02-12 09:10:35 341

原创 PAT-A1146 Topological Order 题目内容及题解

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 supposed to write a program to test...

2019-02-12 09:10:06 462

原创 PAT-A1145 Hashing - Average Search Time 题目内容及题解

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 keys from the table and output the average sea...

2019-02-12 09:09:37 559

原创 PAT-A1144 The Missing Number 题目内容及题解

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. For each case, the first line giv...

2019-02-12 09:08:57 346

原创 PAT-A1143 Lowest Common Ancestor 题目内容及题解

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 defined as a binary tree which has ...

2019-02-12 09:08:32 469

原创 PAT-A1142 Maximal Clique 题目内容及题解

A clique is a subset of vertices of an undirected graph such that every two distinct vertices in the clique are adjacent. A maximal clique is a clique that cannot be extended by including one more adj...

2019-02-12 09:08:05 358

原创 PAT-A1141/B1085 PAT Ranking of Institutions/PAT单位排行 题目内容及题解

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.每次 PAT 考试结束后,考试中心都会发布一个考生单位排行榜。本题就请你实现这个功能。...

2019-02-12 09:07:31 455

原创 PAT-A1140/B1084 Look-and-say Sequence/外观数列 题目内容及题解

Look-and-say sequence is a sequence of integers as the following:外观数列是指具有以下特点的整数序列:D, D1, D111, D113, D11231, D112213111, ...where D is in [0, 9] except 1. The (n+1)st number is a kind of desc...

2019-02-11 11:55:40 415

原创 PAT-A1139 First Contact 题目内容及题解

Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle in the early years. When a boy A had a crush on a girl B, he would usually not contact her directly i...

2019-02-11 11:53:53 887

原创 PAT-A1138 Postorder Traversal 题目内容及题解

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 number of the postorder traversal se...

2019-02-11 11:52:20 288

原创 PAT-A1137/B1080 Final Grading/MOOC期终成绩 题目内容及题解

For a student taking the online course "Data Structures" on China University MOOC (http://www.icourse163.org/), to be qualified for a certificate, he/she must first obtain no less than 200 points from...

2019-02-11 11:50:42 363

原创 PAT-A1136/B1079 A Delayed Palindrome/延迟的回文数 题目内容及题解

Consider a positive integer N written in standard notation with k+1 digits a​i​​ as a​k​​⋯a​1​​a​0​​ with 0≤a​i​​<10 for all i and a​k​​>0. Then N is palindromic if and only if a​i​​=a​k−i​​ for...

2019-02-11 11:48:28 331

原创 PAT-A1135 Is It A Red-Black Tree 题目内容及题解

There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(1) Every node is either red or black. (2) The root is black. (3) Every...

2019-02-11 11:45:27 417

原创 PAT-A1134 Vertex Cover 题目内容及题解

A vertex cover of a graph is a set of vertices such that each edge of the graph is incident to at least one vertex of the set. Now given a graph with several vertex sets, you are supposed to tell if e...

2019-02-11 11:41:32 406

原创 PAT-A1133/B1075 Splitting A Linked List/链表元素分类 题目内容及题解

Given a singly linked list, you are supposed to rearrange its elements so that all the negative values appear before all of the non-negatives, and all the values in [0, K] appear before all those grea...

2019-02-11 11:39:11 332

原创 PAT-A1132 Cut Integer 题目内容及题解

Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting...

2019-02-11 11:36:36 226

原创 PAT-A1131 Subway Map 题目内容及题解

In the big cities, the subway systems always look so complex to the visitors. To give you some sense, the following figure shows the map of Beijing subway. Now you are supposed to help people with you...

2019-02-11 11:33:42 849

原创 PAT-A1130 Infix Expression 题目内容及题解

Given a syntax tree (binary), you are supposed to output the corresponding infix expression, with parentheses reflecting the precedences of the operators.Input Specification:Each input file contai...

2019-02-10 12:42:22 374

原创 PAT-A1129 Recommendation System 题目内容及题解

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's preference by the number of time...

2019-02-10 12:41:42 559

原创 PAT-A1128 N Queens Puzzle 题目内容及题解

The "eight queens puzzle" is the problem of placing eight chess queens on an 8×8 chessboard so that no two queens threaten each other. Thus, a solution requires that no two queens share the same row, ...

2019-02-10 12:41:18 308

原创 PAT-A1127 ZigZagging on a Tree 题目内容及题解

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 stand...

2019-02-10 12:40:26 303

原创 PAT-A1126 Eulerian Path 题目内容及题解

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 same vertex. They were firs...

2019-02-10 12:39:53 394

原创 PAT-A1125/B1070 Chain the Ropes/结绳 题目内容及题解

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 the figure. The resulting chai...

2019-02-10 12:39:11 361

原创 PAT-A1124/B1069 Raffle for Weibo Followers/微博转发抽奖 题目内容及题解

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 followers who forwarded his post, and give...

2019-02-10 12:38:14 285

原创 PAT-A1123 Is It a Complete AVL Tree 题目内容及题解

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 more than one, rebalancing is...

2019-02-10 12:37:37 415

原创 PAT-A1122 Hamiltonian Cycle 题目内容及题解

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 supposed to tell if a given cycle ...

2019-02-10 12:36:50 799

原创 PAT-A1121/B1065 Damn Single/单身狗 题目内容及题解

"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.“单身狗”是中文对于单身人士的一种爱称。本题请你从上万人的大型...

2019-02-10 12:36:06 428

原创 PAT-A1120/B1064 Friend Numbers/朋友数 题目内容及题解

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+3 = 5+1 = 6, and 6 is their ...

2019-02-09 09:08:13 274

原创 PAT-A1119 Pre- and Post-order Traversals 题目内容及题解

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, or preorder and inorder ...

2019-02-09 09:07:22 356

原创 PAT-A1118 Birds in Forest 题目内容及题解

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 scientists to count the maxi...

2019-02-09 09:06:53 337

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除