![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
PAT
cyberickk
这个作者很懒,什么都没留下…
展开
-
PAT 甲级1113 Integer Set Partition
1113 Integer Set PartitionGiven a set of N (>1) positive integers, you are supposed to partition them into two disjoint sets A1 and A2 of n1 and n2 numbers, respectively. Let S1 and S2 denote the sums of all the numbers in A1 and A2, respectively. You原创 2020-05-17 16:54:26 · 110 阅读 · 0 评论 -
PAT 甲级1117 Eddington Number
1117 Eddington NumberBritish astronomer Eddington liked to ride a bike. It is said that in order to show off his skill, he has even defined an “Eddington number”, E – that is, the maximum integer E such that it is for E days that one rides more than E mil原创 2020-05-15 16:07:14 · 91 阅读 · 0 评论 -
PAT 甲级1121 Damn Single
1121 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.Input Specification:Each input file contains one test case. For each c原创 2020-05-14 18:46:57 · 109 阅读 · 0 评论 -
PAT 甲级1126 Eulerian Path
1126 Eulerian PathIn 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 first discussed by Leonhard Euler while s原创 2020-05-14 16:42:34 · 148 阅读 · 3 评论 -
PAT 甲级1125 Chain the Ropes
1125 Chain the RopesGiven 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 chain will be treated as another segmen原创 2020-05-14 10:19:46 · 121 阅读 · 0 评论 -
PAT 甲级1129 Recommendation System
1129 Recommendation SystemRecommendation 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 times that an item has been acces原创 2020-05-13 18:14:17 · 88 阅读 · 0 评论 -
PAT 甲级1134 Vertex Cover
1134 Vertex CoverA 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 each of them is a vertex cover or not.原创 2020-05-13 10:25:05 · 146 阅读 · 0 评论 -
PAT 甲级1137 Final Grading
1137 Final GradingFor 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 the online programming assignments,原创 2020-05-12 10:44:39 · 150 阅读 · 0 评论 -
PAT 甲级1142 Maximal Clique
1142 Maximal CliqueA 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 adjacent vertex. (Quoted from https://e原创 2020-05-11 21:14:25 · 123 阅读 · 0 评论 -
PAT 甲级1141 PAT Ranking of Institutions
1141 PAT Ranking of InstitutionsAfter each PAT, the PAT Center will announce the ranking of institutions based on their students’ performances. Now you are asked to generate the ranklist.Input Specification:Each input file contains one test case. For ea原创 2020-05-10 11:07:58 · 135 阅读 · 0 评论 -
PAT 甲级1146 Topological Order
1146 Topological OrderThis 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 each of the options.Input Spec原创 2020-05-09 23:44:58 · 164 阅读 · 0 评论 -
PAT 甲级1145 Hashing - Average Search Time
1145 Hashing - Average Search TimeThe 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 t...原创 2020-05-08 11:28:24 · 174 阅读 · 0 评论 -
PAT 甲级1150 Travelling Salesman Problem
1150 Travelling Salesman ProblemThe “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 rou...原创 2020-05-07 18:03:31 · 95 阅读 · 0 评论 -
PAT 甲级1149 Dangerous Goods Packaging
1149 Dangerous Goods PackagingWhen 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...原创 2020-05-07 18:02:17 · 95 阅读 · 0 评论 -
PAT 甲级1154 Vertex Coloring
1154 Vertex ColoringA 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 i...原创 2020-05-07 18:01:35 · 94 阅读 · 0 评论 -
PAT 甲级1124 Raffle for Weibo Followers
1124 Raffle for Weibo FollowersJohn 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 w...原创 2020-05-01 16:44:42 · 112 阅读 · 1 评论 -
PAT 甲级1104 Sum of Number Segments
1104 Sum of Number SegmentsGiven a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For example, given the sequence { 0.1, 0.2, 0.3, 0.4 }, we have 10 segments: (0....原创 2020-05-01 10:24:22 · 103 阅读 · 0 评论 -
PAT 甲级 1116 Come on! Let's C
1116 Come on! Let’s C“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, the aw...原创 2020-04-27 15:39:49 · 113 阅读 · 0 评论 -
PAT 甲级 1120 Friend Numbers
1120 Friend NumbersTwo 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 ...原创 2020-04-26 22:30:15 · 88 阅读 · 0 评论 -
PAT 甲级1153 Decode Registration Card of PAT
1153 Decode Registration Card of PATA 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 2...原创 2020-04-21 17:58:36 · 137 阅读 · 0 评论 -
PAT 甲级1148 Werewolf - Simple Version
1148 Werewolf - Simple VersionWerewolf(狼人杀) 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 i...原创 2020-04-21 17:57:44 · 133 阅读 · 0 评论 -
PAT 甲级1140 Look-and-say Sequence
1140 Look-and-say SequenceLook-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 ...原创 2020-04-21 17:56:51 · 100 阅读 · 0 评论 -
PAT 甲级1136 A Delayed Palindrome
1136 A Delayed PalindromeConsider a positive integer N written in standard notation with k+1 digits a**i as a**k⋯a1a0 with 0≤a**i<10 for all i and a**k>0. Then N is palindromic if and only if a...原创 2020-04-21 17:55:43 · 148 阅读 · 0 评论 -
PAT 甲级1132 Cut Integer (20分)
1132 Cut Integer (20分)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 =...原创 2020-04-21 17:54:34 · 119 阅读 · 0 评论 -
PAT 甲级 1128 N Queens Puzzle
1128 N Queens PuzzleThe “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...原创 2020-04-21 17:53:13 · 107 阅读 · 0 评论 -
PAT乙级-basic_level-笔记
代码:https://github.com/cyberickk/PAT/basic1051-复数乘法思路分析输入:复数的指数形式,求两个复数的乘积主体:求乘积,指数形式下,模相乘,辐角相加指数形式转换为常规形式输出:重点规定输出格式的最好采用printf形式为a+bi,对虚部要进行正负判断,为正则多输出一个“+”号小数点后保留两位 %.2f,数字可以按需求替换复数的...原创 2020-03-04 11:57:09 · 138 阅读 · 0 评论