PAT
豌豆射手GCC
这个作者很懒,什么都没留下…
展开
-
结构体排序+赋值 1025 PAT Ranking (25分)
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 plac...原创 2020-04-30 20:54:03 · 117 阅读 · 0 评论 -
等位大数字符串加法+回文数 1024 Palindromic Number (25分)
1024 Palindromic Number (25分)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 single digit n...原创 2020-04-30 19:41:14 · 146 阅读 · 0 评论 -
大数相加+string表示大数 1023 Have Fun with Numbers (20分)
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 happens...原创 2020-04-29 16:08:32 · 90 阅读 · 0 评论 -
cin.get+getchar+getline+stringstream+输入输出流 1022 Digital Library (30分)
1022 Digital Library (30分)A Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and published years. Each book is assigned...原创 2020-04-29 14:46:54 · 104 阅读 · 0 评论 -
判断图是否连通+判断图是否有环+并集得到最深叶节点 1021 Deepest Root (25分)
1021 Deepest Root (25分)A graph which is connected and acyclic can be considered a tree. The height of the tree depends on the selected root. Now you are supposed to find the root that results in a hi...原创 2020-04-29 12:46:00 · 197 阅读 · 0 评论 -
后序遍历+中序遍历+层序遍历+数组表示二叉树 1020 Tree Traversals (25分)
1020 Tree Traversals (25分)Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequences, you are supposed to output the level order tr...原创 2020-04-28 16:52:44 · 193 阅读 · 0 评论 -
进制转换+回文字符串+int数组保存进制数 1019 General Palindromic Number (20分)
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 single...原创 2020-04-28 14:17:38 · 92 阅读 · 0 评论 -
优先队列+流程模拟 1017 Queueing at Bank (25分)
1017 Queueing at Bank (25分)Suppose a bank has K windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. All the customers have to wait ...原创 2020-04-28 13:24:03 · 252 阅读 · 0 评论 -
筛选有效数据+结构排序+统一化时间计算+map映射 名称:记录列表 1016 Phone Bills (25分)
1016 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 day when ...原创 2020-04-26 22:27:51 · 136 阅读 · 0 评论 -
进制转换+可逆质数 1015 Reversible Primes (20分)
1015 Reversible Primes (20分)A reversible prime in any number system is a prime whose “reverse” in that number system is also a prime. For example in the decimal system 73 is a reversible prime becaus...原创 2020-04-26 14:54:26 · 251 阅读 · 1 评论 -
流程模拟+多条件多细节+队列模拟+递增时间判断 1014 Waiting in Line (30分)
1014 Waiting in Line (30分)Suppose a bank has N windows open for service. There is a yellow line in front of the windows which devides the waiting area into two parts. The rules for the customers to w...原创 2020-04-26 14:07:59 · 153 阅读 · 0 评论 -
双向图链式存储+统计最大连通子图 +多输出输出 1013 Battle Over Cities (25分)
1013 Battle Over Cities (25分)It is vitally important to have all the cities connected by highways in a war. If a city is occupied by the enemy, all the highways from/toward that city are closed. We m...原创 2020-04-25 16:53:22 · 152 阅读 · 0 评论 -
哈希查找+sort配合compare+映射 1012 The Best Rank (25分)
1012 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 (Calculus or Lin...原创 2020-04-25 12:29:19 · 136 阅读 · 0 评论 -
贪心策略+构造映射 1011 World Cup Betting (20分)
1011 World Cup Betting (20分)With the 2010 FIFA World Cup running, football fans the world over were becoming increasingly excited as the best players from the best teams doing battles for the World C...原创 2020-04-25 10:54:13 · 163 阅读 · 0 评论 -
进制转换+二分查找 1010 Radix (25分)
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 pair ...原创 2020-04-24 15:11:13 · 350 阅读 · 0 评论 -
多项式乘法细节+数组越界+输出细节 1009 Product of Polynomials (25分)
1009 Product of Polynomials (25分)This time, you are supposed to find A×B where A and B are two polynomials.Input Specification:Each input file contains one test case. Each case occupies 2 lines, an...原创 2020-04-24 12:10:42 · 151 阅读 · 0 评论 -
条件判断 1008 Elevator (20分)
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 o...原创 2020-04-24 11:13:20 · 162 阅读 · 0 评论 -
最大子数列和+动态处理 1007 Maximum Subsequence Sum (25分)
1007 Maximum Subsequence Sum (25分)Given a sequence of K integers { N1 , N2 , …, NK }. A continuous subsequence is defined to be { Ni , Ni+1 , …, Nj } where 1≤i≤j≤K. Th...原创 2020-04-23 14:07:46 · 215 阅读 · 0 评论 -
string处理储存数字+string输入+输出 1005 Spell It Right (20分) 1006 Sign In and Sign Out (25分)
1005 Spell It Right (20分)Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.Input Specification:Each input file con...原创 2020-04-23 12:04:34 · 271 阅读 · 0 评论 -
结构数组排序+compare函数+多细节 1075 PAT Judge (25分)
1075 PAT Judge (25分)The ranklist of PAT is generated from the status list, which shows the scores of the submissions. This time you are supposed to generate the ranklist for PAT.Input Specification:...原创 2020-04-18 15:18:43 · 240 阅读 · 0 评论 -
多叉树层序遍历+统计多叉树叶节点 1004 Counting Leaves (30分)
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 contains one test case. Each case starts w...原创 2020-04-22 14:04:40 · 1120 阅读 · 0 评论 -
to_string函数+数字的标准输出 1001 A+B Format (20分) 多项式加法 1002 A+B for Polynomials (25分)
1001 A+B Format (20分)Calculate a+b and output the sum in standard format – that is, the digits must be separated into groups of three by commas (unless there are less than four digits).Input Specifi...原创 2020-04-21 14:10:13 · 193 阅读 · 0 评论 -
快速排序+动态规划+输出细节 1101 Quick Sort (25分)
1101 Quick Sort (25分)There is a classical process named partition in the famous quick sort algorithm. In this process we typically choose one element as the pivot. Then the elements less than the piv...原创 2020-04-21 12:44:56 · 568 阅读 · 0 评论