
PAT练习题
文章平均质量分 82
CrazyOnes
个人邮箱:[email protected]
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
PAT A1084 B1029 (甲级 乙级)
1084 Broken Keyboard (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 200ms内存限制: 64MB代码长度限制: 16KBOn a broken keyboard, some of the keys are worn out. So when you type some sentences, the characters c...原创 2018-08-09 17:04:34 · 319 阅读 · 0 评论 -
PAT A 1091(甲级)
1091 Acute Stroke(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 600 ms内存限制: 64 MB代码长度限制: 16 KBOne important factor to identify acute stroke (急性脑卒中) is the volume of the stroke core. Given the results of...原创 2018-09-06 16:32:23 · 471 阅读 · 0 评论 -
PAT A 1103(甲级)
1103 Integer Factorization(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 1200 ms内存限制: 64 MB代码长度限制: 16 KBThe K−P factorization of a positive integer N is to write N as the sum of the P-th power of K posi...原创 2018-09-06 16:09:20 · 459 阅读 · 0 评论 -
PAT A 1052(甲级)
1052 Linked List Sorting(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBA linked list consists of a series of structures, which are not necessarily adjacent in memory. We as...原创 2018-09-06 14:15:23 · 794 阅读 · 0 评论 -
PAT A 1032(甲级)
1032 Sharing(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200 ms内存限制: 64 MB代码长度限制: 16 KBTo store English words, one method is to use linked lists and store a word letter by letter. To save some space, ...原创 2018-09-06 13:57:22 · 968 阅读 · 3 评论 -
PAT A 1074 B 1025(甲级 乙级)—— 静态链表的使用
1074 Reversing Linked List(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBGiven a constant K and a singly linked list L, you are supposed to reverse the links of every K ele...原创 2018-09-06 11:09:10 · 610 阅读 · 0 评论 -
PAT A 1104 B 1049 (甲级 乙级)
1104 Sum of Number Segments(20 分)作者: CAO, Peng单位: Google时间限制: 200 ms内存限制: 64 MB代码长度限制: 16 KBGiven a sequence of positive numbers, a segment is defined to be a consecutive subsequence. For ...原创 2018-09-03 21:16:48 · 286 阅读 · 0 评论 -
PAT A 1069 B 1019(甲级 乙级)
1069 The Black Hole of Numbers(20 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200 ms内存限制: 64 MB代码长度限制: 16 KBFor any 4-digit integer except the ones with all the digits being the same, if we sort the digi...原创 2018-09-03 20:04:55 · 361 阅读 · 0 评论 -
PAT A 1051(甲级)
1051 Pop Sequence(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBGiven a stack which can keep M numbers at most. Push N numbers in the order of 1, 2, 3, ..., N and pop rando...原创 2018-09-05 22:04:50 · 682 阅读 · 0 评论 -
PAT A 1020(甲级)
1020 Tree Traversals(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBSuppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorde...原创 2018-09-06 19:11:42 · 665 阅读 · 0 评论 -
PAT A 1086(甲级)
1086 Tree Traversals Again(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBAn inorder binary tree traversal can be implemented in a non-recursive way with a stack. For exampl...原创 2018-09-06 19:36:27 · 438 阅读 · 0 评论 -
PAT A 1107(甲级)
1107 Social Clusters(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 1200 ms内存限制: 64 MB代码长度限制: 16 KBWhen register on a social network, you are always asked to specify your hobbies in order to find some po...原创 2018-09-07 15:13:45 · 451 阅读 · 0 评论 -
PAT A 1151(甲级 2018年9月真题第四题)
1151 LCA in a Binary Tree(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 1000 ms内存限制: 64 MB代码长度限制: 16 KBThe lowest common ancestor (LCA) of two nodes U and V in a tree is the deepest node that has both U...原创 2018-09-10 22:28:34 · 1985 阅读 · 0 评论 -
PAT A 1066(甲级)
1066 Root of AVL Tree(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBAn AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtree...原创 2018-09-07 11:24:26 · 346 阅读 · 0 评论 -
PAT A 1043(甲级)
1043 Is It a Binary Search Tree(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBA Binary Search Tree (BST) is recursively defined as a binary tree which has the following pro...原创 2018-09-07 10:35:34 · 654 阅读 · 0 评论 -
PAT A 1094(甲级)
1094 The Largest Generation(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200 ms内存限制: 64 MB代码长度限制: 16 KBA family hierarchy is usually presented by a pedigree tree where all the nodes on the same level b...原创 2018-09-07 09:53:31 · 432 阅读 · 0 评论 -
PAT A 1090(甲级)
1090 Highest Price in Supply Chain(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200 ms内存限制: 64 MB代码长度限制: 16 KBA supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- ever...原创 2018-09-06 21:30:40 · 552 阅读 · 0 评论 -
PAT A 1079(甲级)
1079 Total Sales of Supply Chain(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 250 ms内存限制: 64 MB代码长度限制: 16 KBA supply chain is a network of retailers(零售商), distributors(经销商), and suppliers(供应商)-- everyo...原创 2018-09-06 21:17:21 · 490 阅读 · 0 评论 -
PAT A 1053(甲级)
1053 Path of Equal Weight(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBGiven a non-empty tree with root R, and with weight Wi assigned to each tree node Ti. The weig...原创 2018-09-06 21:01:46 · 576 阅读 · 0 评论 -
PAT A 1063(甲级)
1063 Set Similarity(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 500 ms内存限制: 64 MB代码长度限制: 16 KBGiven two sets of integers, the similarity of the sets is defined to be Nc/Nt×100%, where Nc is t...原创 2018-09-05 13:27:36 · 278 阅读 · 0 评论 -
PAT A 1018(甲级)
1018 Public Bike Management(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBThere is a public bike service in Hangzhou City which provides great convenience to the tourists f...原创 2018-09-07 20:20:10 · 2206 阅读 · 0 评论 -
PAT 甲级 1012(上)
1012The Best Rank (25)(25分)作者:CHEN, Yue单位:PAT联盟时间限制:400ms内存限制:64MB代码长度限制:16KBTo evaluate the performance of our first year CS majored students, we consider their grades of three cou...原创 2018-08-06 20:23:37 · 784 阅读 · 6 评论 -
PAT B 1038(乙级)
1038 统计同成绩学生(20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 250ms内存限制: 64MB代码长度限制: 16KB本题要求读入N名学生的成绩,将获得某一给定分数的学生人数输出。输入格式:输入在第1行给出不超过10^5^的正整数N,即学生总人数。随后1行给出N名学生的百分制整数成绩,中间以空格分隔。最后1行给出要查询的分数个数K...原创 2018-08-10 17:26:19 · 176 阅读 · 0 评论 -
PAT B 1042(乙级)
1042 字符统计(20 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400ms内存限制: 64MB代码长度限制: 16KB请编写程序,找出一段给定文字中出现最频繁的那个英文字母。输入格式:输入在一行中给出一个长度不超过 1000 的字符串。字符串由 ASCII 码表中任意可见字符及空格组成,至少包含 1 个英文字母,以回车结束(回车不算在内)。输...原创 2018-08-10 17:13:38 · 278 阅读 · 0 评论 -
PAT A 1015(甲级)
1015 Reversible Primes (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 400ms内存限制: 64MB代码长度限制: 16KBA reversible prime in any number system is a prime whose "reverse" in that number system is also a p...原创 2018-08-10 17:02:22 · 549 阅读 · 0 评论 -
PAT B 1007(乙级)
1007 素数对猜想(20 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200ms内存限制: 64MB代码长度限制: 16KB让我们定义dn为:dn=pn+1−pn,其中pi是第i个素数。显然有d1=1,且对于n>1有dn是偶数。“素数对猜想”认为“存在无穷多对相邻且差为2的素数”。现给定任意正整数N(<...原创 2018-08-10 16:28:02 · 247 阅读 · 0 评论 -
PAT B 1033(乙级)—— PAT C++编译器无法使用gets及解决方案
1033 旧键盘打字(20 分)作者: CHEN, Yue单位: 浙江大学时间限制: 200ms内存限制: 64MB代码长度限制: 16KB旧键盘上坏了几个键,于是在敲一段文字的时候,对应的字符就不会出现。现在给出应该输入的一段文字、以及坏掉的那些键,打出的结果文字会是怎样?输入格式:输入在 2 行中分别给出坏掉的那些键、以及应该输入的文字。其中对应英文字母的坏键以...原创 2018-08-10 14:30:08 · 7929 阅读 · 4 评论 -
PAT B 1013(乙级)—— Eratosthenes筛法的简单应用
1013 数素数 (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 200ms内存限制: 64MB代码长度限制: 16KB令P~i~表示第i个素数。现任给两个正整数M <= N <= 10^4^,请输出P~M~到P~N~的所有素数。输入格式:输入在一行中给出M和N,其间以空格分隔。输出格式:输出从P~M~到P~N~的所有...原创 2018-08-10 16:18:39 · 430 阅读 · 0 评论 -
PAT B 1043(乙级)
1043 输出PATest(20 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400ms内存限制: 64MB代码长度限制: 16KB给定一个长度不超过 104 的、仅由英文字母构成的字符串。请将字符重新调整顺序,按 PATestPATest.... 这样的顺序输出,并忽略其它字符。当然,六种字符的个数不一定是一样多的,若某种字符已经输出完,则余下的字符仍...原创 2018-08-12 12:02:08 · 361 阅读 · 0 评论 -
PAT B 1005(乙级)
1005 继续(3n+1)猜想 (25)(25 分)作者: CHEN, Yue单位: PAT联盟时间限制: 400ms内存限制: 64MB代码长度限制: 16KB卡拉兹(Callatz)猜想已经在1001中给出了描述。在这个题目里,情况稍微有些复杂。当我们验证卡拉兹猜想的时候,为了避免重复计算,可以记录下递推过程中遇到的每一个数。例如对n=3进行验证的时候,我们需要计算...原创 2018-08-12 17:18:52 · 332 阅读 · 0 评论 -
PAT A 1003(甲级)
1003 Emergency(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBAs an emergency rescue team leader of a city, you are given a special map of your country. The map shows severa...原创 2018-09-07 20:03:53 · 453 阅读 · 2 评论 -
PAT A 1076(甲级)
1076 Forwards on Weibo(30 分)作者: CHEN, Yue单位: 浙江大学时间限制: 3000 ms内存限制: 64 MB代码长度限制: 16 KBWeibo is known as the Chinese version of Twitter. One user on Weibo may have many followers, and may f...原创 2018-09-07 19:32:49 · 577 阅读 · 1 评论 -
PAT A 1047(甲级)
1047 Student List for Course(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 1000 ms内存限制: 64 MB代码长度限制: 16 KBZhejiang University has 40,000 students and provides 2,500 courses. Now given the registered cou...原创 2018-09-04 22:26:05 · 391 阅读 · 0 评论 -
PAT A 1039(甲级)
1039 Course List for Student(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 600 ms内存限制: 64 MB代码长度限制: 16 KBZhejiang University has 40000 students and provides 2500 courses. Now given the student name list...原创 2018-09-04 20:59:53 · 570 阅读 · 0 评论 -
PAT A 1092 B 1039(甲级 乙级)
1092 To Buy or Not to Buy (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 100ms内存限制: 64MB代码长度限制: 16KBEva would like to make a string of beads with her favorite colors so she went to a small shop to ...原创 2018-08-15 23:08:08 · 233 阅读 · 0 评论 -
PAT A 1096(甲级)
1096 Consecutive Factors (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 400ms内存限制: 64MB代码长度限制: 16KBAmong all the factors of a positive integer N, there may exist several consecutive numbers. For ex...原创 2018-08-15 21:54:31 · 809 阅读 · 0 评论 -
PAT A 1050(甲级)
1050 String Subtraction (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 100ms内存限制: 64MB代码长度限制: 16KBGiven two strings S~1~ and S~2~, S = S~1~ - S~2~ is defined to be the remaining string after taking...原创 2018-08-12 18:08:53 · 260 阅读 · 0 评论 -
PAT A 1041(甲级)
1041 Be Unique (20)(20 分)作者: CHEN, Yue单位: PAT联盟时间限制: 100ms内存限制: 64MB代码长度限制: 16KBBeing unique is so important to people on Mars that even their lottery is designed in a unique way. The rule...原创 2018-08-12 17:40:47 · 376 阅读 · 0 评论 -
PAT A 1013(甲级)
1013 Battle Over Cities(25 分)作者: CHEN, Yue单位: 浙江大学时间限制: 400 ms内存限制: 64 MB代码长度限制: 16 KBIt is vitally important to have all the cities connected by highways in a war. If a city is occupied b...原创 2018-09-07 16:49:47 · 562 阅读 · 0 评论