
PAT
rv0p111
之前由于一些原因博客没有更新,现在还是正常更新,继续分享..
展开
-
PAT 甲级 1103
1113. Integer Set Partition (25)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. Let S1 and S2原创 2016-12-27 11:48:38 · 661 阅读 · 0 评论 -
PAT-甲级-1006
1006. Sign In and Sign Out (25)At the beginning of every day, the first person who signs in the computer room will unlock the door, and the last one who signs out will lock the door. Given the r原创 2017-01-07 07:56:19 · 497 阅读 · 0 评论 -
PAT-甲级-1004
1004. Counting Leaves (30)时间限制400 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueA family hierarchy is usually presented by a原创 2017-01-07 07:38:17 · 577 阅读 · 0 评论 -
PAT-甲级-1002
1002. A+B for Polynomials (25)This time, you are supposed to find A+B where A and B are two polynomials.InputEach input file contains one test case. Each case occupies 2 lines, and each原创 2016-12-31 09:02:18 · 1223 阅读 · 0 评论 -
PAT-甲级1009
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原创 2017-01-09 23:26:35 · 362 阅读 · 0 评论 -
PAT-甲级-1007
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 Maximum Subsequence is the continu原创 2017-01-08 22:10:24 · 385 阅读 · 0 评论 -
PAT-甲级-1011
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 Wo原创 2017-01-12 22:12:21 · 398 阅读 · 0 评论 -
PAT-甲级-1013
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.原创 2017-01-17 21:18:46 · 539 阅读 · 0 评论 -
PAT-甲级-1019
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 s原创 2017-01-18 20:56:57 · 389 阅读 · 0 评论 -
PAT-1023-Have Fun with Numbers
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原创 2017-02-09 21:17:27 · 1054 阅读 · 0 评论 -
PAT-乙级-1058
1058. 选择题(20)批改多选题是比较麻烦的事情,本题就请你写个程序帮助老师批改多选题,并且指出哪道题错的人最多。输入格式:输入在第一行给出两个正整数N(输出格式:按照输入的顺序给出每个学生的得分,每个分数占一行。注意判题时只有选择全部正确才能得到该题的分数。最后一行输出错得最多的题目的错误次数和编号(题目按照输入的顺序从1开始编号)。如果有并列,则原创 2016-12-29 12:37:11 · 831 阅读 · 0 评论 -
PAT-乙级-1052
1052. 卖个萌 (20)萌萌哒表情符号通常由“手”、“眼”、“口”三个主要部分组成。简单起见,我们假设一个表情符号是按下列格式输出的:[左手]([左眼][口][右眼])[右手]现给出可选用的符号集合,请你按用户的要求输出表情。输入格式:输入首先在前三行顺序对应给出手、眼、口的可选符号集。每个符号括在一对方括号[]内。题目保证每个集合都至少有一个符号,并原创 2016-12-29 12:15:08 · 599 阅读 · 0 评论 -
PAT 甲级 1120
1120. Friend Numbers (20)Two 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原创 2016-12-26 21:43:37 · 368 阅读 · 0 评论 -
PAT 甲级 1122
1122. Hamiltonian Cycle (25)时间限制300 ms内存限制65536 kB代码长度限制16000 B判题程序Standard作者CHEN, YueThe "Hamilton cycle problem" is to find原创 2016-12-26 22:12:32 · 473 阅读 · 0 评论 -
PAT 乙级 1065
1065. 单身狗(25)“单身狗”是中文对于单身人士的一种爱称。本题请你从上万人的大型派对中找出落单的客人,以便给予特殊关爱。输入格式:输入第一行给出一个正整数N(输出格式:首先第一行输出落单客人的总人数;随后第二行按ID递增顺序列出落单的客人。ID间用1个空格分隔,行的首尾不得有多余空格。输入样例:311111 2222233333原创 2016-12-27 11:23:24 · 930 阅读 · 0 评论 -
PAT 甲级 1114
1114. Family Property (25)This time, you are supposed to help us collect the data for family-owned property. Given each person's family members, and the estate(房产)info under his/her own name, we原创 2016-12-27 18:13:46 · 438 阅读 · 0 评论 -
PAT—甲级-1086
1086. Tree Traversals Again (25)An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the keys number原创 2016-12-28 20:29:58 · 521 阅读 · 0 评论 -
PAT-乙级-1013
1013. 数素数 (20)令Pi表示第i个素数。现任给两个正整数M 4,请输出PM到PN的所有素数。输入格式:输入在一行中给出M和N,其间以空格分隔。输出格式:输出从PM到PN的所有素数,每10个数字占1行,其间以空格分隔,但行末不得有多余空格。输入样例:5 27输出样例:11 13 17 19 23 29 31 37 41 434原创 2016-12-29 08:39:50 · 560 阅读 · 0 评论 -
PAT-乙级-1025
1025. 反转链表 (25)给定一个常数K以及一个单链表L,请编写程序将L中每K个结点反转。例如:给定L为1→2→3→4→5→6,K为3,则输出应该为3→2→1→6→5→4;如果K为4,则输出应该为4→3→2→1→5→6,即最后不到K个元素不反转。输入格式:每个输入包含1个测试用例。每个测试用例第1行给出第1个结点的地址、结点总个数正整数N(5)、以及正整数K(原创 2016-12-29 09:20:56 · 412 阅读 · 0 评论 -
PAT-乙级-1015
1015. 德才论 (25)宋代史学家司马光在《资治通鉴》中有一段著名的“德才论”:“是故才德全尽谓之圣人,才德兼亡谓之愚人,德胜才谓之君子,才胜德谓之小人。凡取人之术,苟不得圣人,君子而与之,与其得小人,不若得愚人。”现给出一批考生的德才分数,请根据司马光的理论给出录取排名。输入格式:输入第1行给出3个正整数,分别为:N(5),即考生总数;L(>=60),为录原创 2016-12-29 09:26:53 · 585 阅读 · 0 评论 -
PAT-乙级-1054
1054. 求平均值 (20)本题的基本要求非常简单:给定N个实数,计算它们的平均值。但复杂的是有些输入数据可能是非法的。一个“合法”的输入是[-1000,1000]区间内的实数,并且最多精确到小数点后2位。当你计算平均值的时候,不能把那些非法的数据算在内。输入格式:输入第一行给出正整数N(输出格式:对每个非法输入,在一行中输出“ERROR: X is转载 2016-12-29 09:39:45 · 424 阅读 · 0 评论 -
PAT-乙级-1060
1060. 爱丁顿数(25)英国天文学家爱丁顿很喜欢骑车。据说他为了炫耀自己的骑车功力,还定义了一个“爱丁顿数”E,即满足有E天骑车超过E英里的最大整数E。据说爱丁顿自己的E等于87。现给定某人N天的骑车距离,请你算出对应的爱丁顿数E(输入格式:输入第一行给出一个正整数N(5),即连续骑车的天数;第二行给出N个非负整数,代表每天的骑车距离。输出格式:原创 2016-12-29 09:50:54 · 699 阅读 · 0 评论 -
PAT-1022-Digital Library
1022. Digital Library (30)CHEN, YueA Digital Library contains millions of books, stored according to their titles, authors, key words of their abstracts, publishers, and publ原创 2017-01-30 20:26:46 · 420 阅读 · 0 评论