L_Aster的专栏

相逢的人会再相逢

PAT甲级解题报告索引

PAT甲级题目地址:https://www.patest.cn/contests/pat-a-practise PAT甲级代码Github仓库已经整理更新完毕,包含最新全部代码(C++),部分代码已经加以注解,并使用尽量简单的解题思路以及简洁的代码实现:我的 Github|甲级 欢迎star或...

2017-09-22 23:15:43

阅读数 1697

评论数 0

7-1 Sexy 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 from http://mathworld.wolfram.com/Sex...

2019-03-04 10:28:06

阅读数 103

评论数 0

7-2 Anniversary (25 分)

Zhejiang University is about to celebrate her 122th anniversary in 2019. To prepare for the celebration, the alumni association (校友会) has gathered th...

2019-03-04 10:19:30

阅读数 74

评论数 0

7-3 Telefraud Detection (25 分)

Telefraud(电信诈骗) remains a common and persistent problem in our society. In some cases, unsuspecting victims lose their entire life savings. To stop t...

2019-03-04 10:13:00

阅读数 236

评论数 0

7-4 Structure of a Binary Tree (30 分)

Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, a binary tree can be ...

2019-03-03 21:26:00

阅读数 74

评论数 0

1153 Decode Registration Card of 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...

2019-01-04 11:26:18

阅读数 128

评论数 0

1154 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 col...

2018-12-27 16:46:59

阅读数 92

评论数 0

1155 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 (th...

2018-12-27 14:43:09

阅读数 128

评论数 0

1152 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 sup...

2018-12-27 14:16:03

阅读数 67

评论数 0

1149 Dangerous Goods Packaging (25 分)

1149 Dangerous Goods Packaging (25 分) When shipping goods with containers, we have to be careful not to pack some incompatible goods into the same c...

2018-09-12 17:42:34

阅读数 195

评论数 0

1148 Werewolf - Simple Version (20 分)

1148 Werewolf - Simple Version (20 分) Werewolf(狼人杀) is a game in which the players are partitioned into two parties: the werewolves and the human be...

2018-09-12 17:12:38

阅读数 294

评论数 0

1150 Travelling Salesman Problem(25 分)

1150 Travelling Salesman Problem(25 分) The “travelling salesman problem” asks the following question: “Given a list of cities and the distances betw...

2018-09-08 23:47:45

阅读数 366

评论数 0

1151 LCA in a Binary Tree(30 分)

1151 LCA 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 descend...

2018-09-08 23:19:07

阅读数 189

评论数 0

1144. The Missing Number (20)

1144. The Missing Number (20) #include <bits/stdc++.h> using namespace std; int main() { int n,val; vector<...

2018-03-21 18:43:25

阅读数 190

评论数 0

1145. Hashing - Average Search Time (25)

1145. Hashing - Average Search Time (25) #include <bits/stdc++.h> using namespace std; vector<int> v; in...

2018-03-21 18:42:14

阅读数 371

评论数 0

1146. Topological Order (25)

1146. Topological Order (25) #include <bits/stdc++.h> using namespace std; vector<int> v[1024]; int inde...

2018-03-21 18:40:58

阅读数 149

评论数 0

1147. Heaps (30)

1147. Heaps (30) #include <bits/stdc++.h> using namespace std; vector<int> A,v; int m,n; void postra(int...

2018-03-21 18:39:25

阅读数 149

评论数 0

1143. Lowest Common Ancestor (30)

1143. Lowest Common Ancestor (30) #include <bits/stdc++.h> using namespace std; struct TreeNode { int val; TreeNode *l...

2018-03-19 09:50:57

阅读数 284

评论数 0

1142. Maximal Clique (25)

1142. Maximal Clique (25) #include <bits/stdc++.h> using namespace std; vector<int> v[256]; int A[256]...

2018-03-19 08:54:56

阅读数 85

评论数 0

1141. PAT Ranking of Institutions (25)

1141. PAT Ranking of Institutions (25) #include <bits/stdc++.h> using namespace std; struct node { int rank; string sc...

2018-03-19 08:37:46

阅读数 191

评论数 0

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