07 2019 档案

摘要:Date:2019-07-31 19:03:46 算法实现 阅读全文
posted @ 2019-07-31 19:04 林東雨 阅读(212) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-25 16:03:14 算法实现 阅读全文
posted @ 2019-07-25 16:05 林東雨 阅读(267) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1033 To Fill or Not to Fill (25 分) Description: With highways available, driving a car from Hangzhou to any other city is easy. But since 阅读全文
posted @ 2019-07-24 20:08 林東雨 阅读(224) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1037 Magic Coupon (25 分) Description: The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, 阅读全文
posted @ 2019-07-23 19:25 林東雨 阅读(152) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1038 Recover the Smallest Number (30 分) Description: Given a collection of number segments, you are supposed to recover the smallest numb 阅读全文
posted @ 2019-07-23 19:08 林東雨 阅读(158) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1067 Sort with Swap(0, i) (25 分) Description: Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increas 阅读全文
posted @ 2019-07-23 18:46 林東雨 阅读(226) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1070 Mooncake (25 分) Description: Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of 阅读全文
posted @ 2019-07-22 19:53 林東雨 阅读(162) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-22 19:33:09 总是选择当前最优的策略,来获得全局最优的解 Sample: 阅读全文
posted @ 2019-07-22 19:34 林東雨 阅读(180) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1041 Be Unique (20 分) Description: Being unique is so important to people on Mars that even their lottery is designed in a unique way. Th 阅读全文
posted @ 2019-07-21 20:29 林東雨 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1048 Find Coins (25 分) Description: Eva loves to collect coins from all over the universe, including some other planets like Mars. One da 阅读全文
posted @ 2019-07-21 20:18 林東雨 阅读(449) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1050 String Subtraction (20 分) Description: Given two strings S​1​​ and S​2​​, S=S​1​​−S​2​​ is defined to be the remaining string after 阅读全文
posted @ 2019-07-21 20:00 林東雨 阅读(205) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1084 Broken Keyboard (20 分) Description: On a broken keyboard, some of the keys are worn out. So when you type some sentences, the charac 阅读全文
posted @ 2019-07-21 19:46 林東雨 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1092 To Buy or Not to Buy (20 分) Description: Eva would like to make a string of beads with her favorite colors so she went to a small sh 阅读全文
posted @ 2019-07-21 19:29 林東雨 阅读(142) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1112 Stucked Keyboard (20 分) Description: On a broken keyboard, some of the keys are always stucked. So when you type some sentences, the 阅读全文
posted @ 2019-07-19 19:21 林東雨 阅读(188) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1117 Eddington Number (25 分) Description: British astronomer Eddington liked to ride a bike. It is said that in order to show off his ski 阅读全文
posted @ 2019-07-19 18:44 林東雨 阅读(243) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1121 Damn Single (25 分) Description: "Damn Single (单身狗)" is the Chinese nickname for someone who is being single. You are supposed to fin 阅读全文
posted @ 2019-07-19 18:26 林東雨 阅读(161) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-18 19:58:48 阅读全文
posted @ 2019-07-18 20:00 林東雨 阅读(925) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1012 The Best Rank (25 分) Description: To evaluate the performance of our first year CS majored students, we consider their grades of thr 阅读全文
posted @ 2019-07-17 21:25 林東雨 阅读(168) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1016 Phone Bills (25 分) Description: A long-distance telephone company charges its customers by the following rules: Making a long-distan 阅读全文
posted @ 2019-07-17 20:25 林東雨 阅读(178) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1025 PAT Ranking Description: Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang U 阅读全文
posted @ 2019-07-17 19:20 林東雨 阅读(165) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1028 List Sorting (25 分) Description: Excel can sort records according to any column. Now you are supposed to imitate this function. Inpu 阅读全文
posted @ 2019-07-17 18:56 林東雨 阅读(149) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1055 The World's Richest (25 分) Description: Forbes magazine publishes every year its list of billionaires based on the annual ranking of 阅读全文
posted @ 2019-07-15 19:13 林東雨 阅读(166) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1062 Talent and Virtue (25 分) Description: About 900 years ago, a Chinese philosopher Sima Guang wrote a history book in which he talked 阅读全文
posted @ 2019-07-15 18:44 林東雨 阅读(207) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1075 PAT Judge (25 分) Description: The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This 阅读全文
posted @ 2019-07-14 20:17 林東雨 阅读(220) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1080 Graduate Admission (30 分) Description: It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 ap 阅读全文
posted @ 2019-07-14 19:21 林東雨 阅读(305) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1083 List Grades (25 分) Description: Given a list of N student records with name, ID and grade. You are supposed to sort the records with 阅读全文
posted @ 2019-07-13 10:57 林東雨 阅读(181) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1095 Cars on Campus (30 分) Description: Zhejiang University has 8 campuses and a lot of gates. From each gate we can collect the in/out t 阅读全文
posted @ 2019-07-12 21:34 林東雨 阅读(254) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1101 Quick Sort (25 分) Description: There is a classical process named partition in the famous quick sort algorithm. In this process we t 阅读全文
posted @ 2019-07-11 21:40 林東雨 阅读(188) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1023 Have Fun with Numbers (20 分) Description: Notice that the number 123456789 is a 9-digit number consisting exactly the numbers from 1 阅读全文
posted @ 2019-07-11 20:41 林東雨 阅读(229) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1024 Palindromic Number (25 分) Description: A number that will be the same when it is written forwards or backwards is known as a Palindr 阅读全文
posted @ 2019-07-11 20:26 林東雨 阅读(173) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-11 19:42:01 算法实现 阅读全文
posted @ 2019-07-11 19:43 林東雨 阅读(274) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1059 Prime Factors (25 分) Description: Given any positive integer N, you are supposed to find all of its prime factors, and write them in 阅读全文
posted @ 2019-07-08 20:15 林東雨 阅读(170) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1096 Consecutive Factors (20 分) Description: Among all the factors of a positive integer N, there may exist several consecutive numbers. 阅读全文
posted @ 2019-07-08 19:40 林東雨 阅读(156) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-08 18:56:02 算法实现 阅读全文
posted @ 2019-07-08 18:57 林東雨 阅读(363) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1088 Rational Arithmetic (20 分) Description: For two rational numbers, your task is to implement the basic arithmetics, that is, to calcu 阅读全文
posted @ 2019-07-05 20:37 林東雨 阅读(139) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1081 Rational Sum (20 分) Description: Given N rational numbers in the form numerator/denominator, you are supposed to calculate their sum 阅读全文
posted @ 2019-07-05 20:09 林東雨 阅读(129) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-05 19:35:27 算法实现 1 /* 分数的表示和化简 */ 2 /* 3 1.分数的表示 4 */ 5 6 // 7 //1.down非负,若分数为负,则令up为负 8 //2.分数为零,则令up=0, down=1 9 //3.up和down的gcd=1 10 / 阅读全文
posted @ 2019-07-05 19:36 林東雨 阅读(1520) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-05 19:22:40 算法实现 阅读全文
posted @ 2019-07-05 19:23 林東雨 阅读(185) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1139 First Contact (30 分) Description: Unlike in nowadays, the way that boys and girls expressing their feelings of love was quite subtle 阅读全文
posted @ 2019-07-04 17:21 林東雨 阅读(258) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1124 Raffle for Weibo Followers (20 分) Description: John got a full mark on PAT. He was so happy that he decided to hold a raffle(抽奖) for 阅读全文
posted @ 2019-07-04 15:36 林東雨 阅读(155) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1130 Infix Expression (25 分) Description: Given a syntax tree (binary), you are supposed to output the corresponding infix expression, wi 阅读全文
posted @ 2019-07-04 14:58 林東雨 阅读(167) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1091 Acute Stroke (30 分) Description: One important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the r 阅读全文
posted @ 2019-07-03 15:24 林東雨 阅读(246) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-03 14:29:02 走完一层的所有房间,再走下一层,用队列实现 算法实现 阅读全文
posted @ 2019-07-03 14:32 林東雨 阅读(850) 评论(0) 推荐(0) 编辑
摘要:Source: PAT A1103 Integer Factorization (30 分) Description: The K−P factorization of a positive integer N is to write N as the sum of the P-th power o 阅读全文
posted @ 2019-07-02 18:56 林東雨 阅读(153) 评论(0) 推荐(0) 编辑
摘要:Date:2019-07-01 15:31:11 通俗点理解就是不撞南墙不回头的那种,用栈来实现 算法实现 阅读全文
posted @ 2019-07-01 15:36 林東雨 阅读(1462) 评论(0) 推荐(0) 编辑