03 2020 档案

摘要:1025 PAT Ranking (25分) Programming Ability Test (PAT) is organized by the College of Computer Science and Technology of Zhejiang University. Each test 阅读全文
posted @ 2020-03-27 00:22 Cruel_King 阅读(170) 评论(0) 推荐(0) 编辑
摘要:1020 Tree Traversals (25分) Suppose that all the keys in a binary tree are distinct positive integers. Given the postorder and inorder traversal sequen 阅读全文
posted @ 2020-03-23 22:20 Cruel_King 阅读(434) 评论(0) 推荐(0) 编辑
摘要:原题链接 很久没做dp了,连一道裸地区间dp都没能第一时间想到,我可真是个臭弟弟...... 一开始是用的贪心吧,wa了一发。 本题思路:区间dp的一般思路,先枚举区间长度,然后枚举区间头,然后枚举区间断点,很容易就能想到状态转移方程。 自己关掉博客好好想想吧,区间dp应该是最简单的dp类型了。 # 阅读全文
posted @ 2020-03-23 17:56 Cruel_King 阅读(196) 评论(0) 推荐(0) 编辑
摘要:1018 Public Bike Management (30分) There is a public bike service in Hangzhou City which provides great convenience to the tourists from all over the w 阅读全文
posted @ 2020-03-22 15:22 Cruel_King 阅读(206) 评论(0) 推荐(0) 编辑
摘要:1016 Phone Bills (25分) A long-distance telephone company charges its customers by the following rules: Making a long-distance call costs a certain amo 阅读全文
posted @ 2020-03-20 20:51 Cruel_King 阅读(263) 评论(0) 推荐(0) 编辑
摘要: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 nu 阅读全文
posted @ 2020-03-16 11:04 Cruel_King 阅读(255) 评论(0) 推荐(0) 编辑
摘要: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 cont 阅读全文
posted @ 2020-03-14 15:56 Cruel_King 阅读(128) 评论(0) 推荐(0) 编辑
摘要:1003 Emergency (25分) As an emergency rescue team leader of a city, you are given a special map of your country. The map shows several scattered cities 阅读全文
posted @ 2020-03-14 12:03 Cruel_King 阅读(261) 评论(0) 推荐(0) 编辑
摘要:题目描述 某城镇进行人口普查,得到了全体居民的生日。现请你写个程序,找出镇上最年长和最年轻的人。这里确保每个输入的日期都是合法的,但不一定是合理的——假设已知镇上没有超过200岁的老人,而今天是2014年9月6日,所以超过200岁的生日和未出生的生日都是不合理的,应该被过滤掉。 输入描述: 输入在第 阅读全文
posted @ 2020-03-08 16:58 Cruel_King 阅读(195) 评论(0) 推荐(0) 编辑
摘要:题目描述 给定一个正整数数列,和正整数p,设这个数列中的最大值是M,最小值是m,如果M <= m * p,则称这个数列是完美数列。现在给定参数p和一些正整数,请你从中选择尽可能多的数构成一个完美数列。 输入描述: 输入第一行给出两个正整数N和p,其中N(<= 105)是输入的正整数的个数,p(<= 阅读全文
posted @ 2020-03-08 16:22 Cruel_King 阅读(217) 评论(0) 推荐(0) 编辑
摘要:最近刷pat的时候遇到的题,才发现打比赛训练的时候都没有训练过大数除法,现在练练手写一下,其实和大数加法等思路一样,就是模拟,用字符串模拟除法,保存中间状态。 直接上代码了哈。有不懂的私聊问俺。 /* A除以B:本题是较大的数除以一个较小的数,模拟小学除法。。。或者 java python */ # 阅读全文
posted @ 2020-03-06 14:26 Cruel_King 阅读(198) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示