![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
文章平均质量分 55
Tate_Brown
这个作者很懒,什么都没留下…
展开
-
SPFA+队列优化与迪杰斯特拉+优先队列(最小堆优化)解一道水题
其实算法还是挺有意思的,可惜我年纪大了,搞不动了,这种东西应该适合在中学时候搞。。题目: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 ...原创 2019-07-07 01:02:25 · 490 阅读 · 1 评论 -
PAT甲级1093,1098解题报告
1093 Count PAT's (25 point(s))The string APPAPT contains two PAT's as substrings. The first one is formed by the 2nd, the 4th, and the 6th characters, and the second one is formed by the 3rd, the 4t...原创 2018-11-02 12:48:38 · 344 阅读 · 0 评论 -
PAT甲级1104,1105解题报告
1104 Sum of Number Segments (20 point(s))Given 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 1...原创 2018-11-04 10:45:10 · 346 阅读 · 0 评论 -
PAT甲级1117,1120解题报告
1117 Eddington Number (25 point(s))British 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 max...原创 2018-11-06 23:35:33 · 227 阅读 · 0 评论 -
PAT甲级1089,1092解题报告
1089 Insert or Merge (25 point(s))According to Wikipedia:Insertion sort iterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort remo...原创 2018-11-01 19:10:54 · 303 阅读 · 0 评论 -
PAT甲级1100,1101解题报告
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 Earch is called "jan, feb, mar, apr, may, jun, jly, aug, sep...原创 2018-11-03 13:13:25 · 266 阅读 · 0 评论 -
PAT甲级1074,1075解题报告
1074 Reversing Linked List (25 point(s))Given a constant K and a singly linked list L, you are supposed to reverse the links of every K elements on L. For example, given L being 1→2→3→4→5→6, if K=3,...原创 2018-10-27 12:13:44 · 348 阅读 · 0 评论 -
pat甲级1077,1081题解
1077 Kuchiguse (20 point(s))The Japanese language is notorious for its sentence ending particles. Personal preference of such particles can be considered as a reflection of the speaker's personality...原创 2018-10-30 11:07:10 · 321 阅读 · 0 评论 -
PAT甲级1065,1067题解
1065 A+B and C (64bit) (20 point(s))Given three integers A, B and C in [−263,263], you are supposed to tell whether A+B>C.Input Specification:The first line of the input gives the posit...原创 2018-10-24 23:29:35 · 195 阅读 · 0 评论 -
PAT甲级1085,1088解题报告
1085 Perfect Sequence (25 point(s))Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and mare the maximum and minim...原创 2018-10-31 14:04:45 · 288 阅读 · 0 评论 -
PAT甲级1071,1073解题报告
1071 Speech Patterns (25 point(s))People often have a preference among synonyms of the same word. For example, some may prefer "the police", while others may prefer "the cops". Analyzing such patter...原创 2018-10-26 13:53:44 · 287 阅读 · 0 评论 -
PAT甲级1140,1144解题报告
1140 Look-and-say Sequence (20 point(s))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 nu...原创 2018-11-09 23:46:55 · 206 阅读 · 0 评论 -
PAT甲级1121,1124解题报告
1121 Damn Single (25 point(s))"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....原创 2018-11-08 00:31:50 · 300 阅读 · 0 评论 -
PAT甲级1108,1112解题报告
1108 Finding Average (20 point(s))The basic task is simple: given N real numbers, you are supposed to calculate their average. But what makes it complicated is that some of the input numbers might n...原创 2018-11-05 15:12:06 · 207 阅读 · 0 评论 -
PAT1034 Head of a Gang
上次三月没满分。。开始准备搞九月了,希望这次能满分吧。3月份的时候英文太差了,看的好累,现在感觉还好了些,看运气了。(其实目前唯一自信的科目只有数学,别的。。都是随缘佛系)。今天做了这道题。。我就服了,我三月去的时候没做这道,结果三月是题设背景和这题基本一样的题目就是加深复杂了一点。。我当时都看不懂Gang是什么意思。。血崩。应该是要并查集做,我这边锻炼下模拟能力用STL模拟做了一下也过了...原创 2019-07-04 00:21:27 · 219 阅读 · 0 评论 -
PAT甲级1004,1020解题报告
1004 Counting Leaves (30 point(s))A family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.Input Specification:Each input file c...原创 2019-02-08 16:15:24 · 595 阅读 · 0 评论 -
PAT甲级1147解题报告
1147 Heaps (30 point(s))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 g...原创 2018-11-26 17:30:30 · 276 阅读 · 0 评论 -
PAT甲级1129解题报告
1129 Recommendation System (25 point(s))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 t...原创 2018-11-25 14:04:21 · 493 阅读 · 0 评论 -
PAT甲级1133解题报告
1133 Splitting A Linked List (25 point(s))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 v...原创 2018-11-23 15:14:00 · 462 阅读 · 0 评论 -
PAT甲级1128解题报告
1128 N Queens Puzzle (20 point(s))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 tha...原创 2018-11-25 01:16:35 · 264 阅读 · 0 评论 -
PAT甲级1097解题报告
1097 Deduplication on a Linked List (25 point(s))Given a singly linked list L with integer keys, you are supposed to remove the nodes with duplicated absolute values of the keys. That is, for each v...原创 2018-11-22 18:21:30 · 293 阅读 · 0 评论 -
PAT甲级1125解题报告
好几天没做了已经。。感觉有点变难了,这几天也比较忙就一天一题吧,挑了半天挑了道会做了。1125 Chain the Ropes (25 point(s))Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments int...原创 2018-11-19 19:13:29 · 277 阅读 · 0 评论 -
PAT甲级1141解题报告
1141 PAT Ranking of Institutions (25 point(s))After each PAT, the PAT Center will announce the ranking of institutions based on their students' performances. Now you are asked to generate the ran...原创 2018-11-21 21:02:08 · 299 阅读 · 0 评论 -
PAT甲级1132和1136解题报告
1132 Cut Integer (20 point(s))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 = 16...原创 2018-11-09 00:34:31 · 203 阅读 · 0 评论 -
PAT甲级1113,1116解题报告
1113 Integer Set Partition (25 point(s))Given 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...原创 2018-10-29 11:38:26 · 182 阅读 · 0 评论 -
PAT甲级1062,1063解题报告
1062 Talent and Virtue (25 point(s))About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked about people's talent and virtue. According to his theory, a man bei...原创 2018-10-23 14:19:30 · 266 阅读 · 0 评论 -
PAT甲级1058,1059
1058 A+B in Hogwarts (20 point(s))If you are a fan of Harry Potter, you would know the world of magic has its own currency system -- as Hagrid explained it to Harry, "Seventeen silver Sickles to a G...原创 2018-10-21 10:13:53 · 263 阅读 · 0 评论 -
PAT甲级1023,1024解题报告
1023 Have Fun with Numbers (20 分)Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 to 9, with no duplication. Double it we will obtain 246913578, which happe...原创 2018-10-08 13:01:43 · 403 阅读 · 0 评论 -
PAT甲级1039,1040解题报告
1039 Course List for Student (25 分)Zhejiang University has 40000 students and provides 2500 courses. Now given the student name lists of all the courses, you are supposed to output the registered co...原创 2018-10-14 14:53:14 · 273 阅读 · 0 评论 -
PAT甲级1019,1022解题报告
1019 General Palindromic Number (20 分)A number that will be the same when it is written forwards or backwards is known as a Palindromic Number. For example, 1234321 is a palindromic number. All sing...原创 2018-10-07 14:43:43 · 336 阅读 · 0 评论 -
PAT甲级1037,1038解题报告
1037 Magic Coupon (25 分)The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times t...原创 2018-10-13 13:59:10 · 453 阅读 · 0 评论 -
PAT甲级1016,1017
10161016 Phone Bills (25 分)A long-distance telephone company charges its customers by the following rules:Making a long-distance call costs a certain amount per minute, depending on the time of ...原创 2018-10-06 20:15:05 · 296 阅读 · 0 评论 -
PAT甲级1012,1015解题报告
10121012 The Best Rank (25 分)To evaluate the performance of our first year CS majored students, we consider their grades of three courses only: C - C Programming Language, M - Mathematics (Calculu...原创 2018-10-05 15:07:55 · 452 阅读 · 0 评论 -
PAT甲级1035,1036解题报告
1035 Password (20 分)To prepare for PAT, the judge sometimes has to generate random passwords for the users. The problem is that there are always some confusing passwords since it is hard to distingu...原创 2018-10-12 14:05:10 · 165 阅读 · 0 评论 -
PAT甲级1010,1011解题报告
1010 Radix (25 分)Given a pair of positive integers, for example, 6 and 110, can this equation 6 = 110 be true? The answer is yes, if 6 is a decimal number and 110 is a binary number.Now for any pa...原创 2018-10-04 16:05:03 · 429 阅读 · 0 评论 -
PAT甲级1008,1009解题报告
1008 Elevator (20 分)The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified...原创 2018-10-03 20:33:24 · 282 阅读 · 0 评论 -
PAT甲级1031,1032解题报告
1031 Hello World for U (20 分)Given any string of N (≥5) characters, you are asked to form the characters into the shape of U. For example, helloworld can be printed as:h de ll rlowoThat ...原创 2018-10-11 17:20:09 · 340 阅读 · 0 评论 -
PAT甲级1041,1042解题报告
1041 Be Unique (20 分)Being unique is so important to people on Mars that even their lottery is designed in a unique way. The rule of winning is simple: one bets on a number chosen from [1,104]. T...原创 2018-10-15 10:36:10 · 280 阅读 · 0 评论 -
PAT甲级1050,1051解题报告
1050 String Subtraction (20 point(s))Given two strings S1 and S2, S=S1−S2 is defined to be the remaining string after taking all the characters in S2 from S1. Your task is simpl...原创 2018-10-18 18:04:53 · 360 阅读 · 0 评论 -
PAT甲级1025,1027解题报告
1025 PAT Ranking (25 分)Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test is supposed to run simultaneously in several pl...原创 2018-10-09 14:12:40 · 223 阅读 · 0 评论