贪心
shishiness
这个作者很懒,什么都没留下…
展开
-
pat 甲级 贪心 A1038 Recover the Smallest Number (30分)
1038 Recover the Smallest Number (30分) Given a collection of number segments, you are supposed to recover the smallest number from them. For example, given { 32, 321, 3214, 0229, 87 }, we can recover many numbers such like 32-321-3214-0229-87 or 0229-32-8原创 2020-07-23 12:01:02 · 73 阅读 · 0 评论 -
pat 甲级 贪心 A1037 Magic Coupon (25分)(简单
1037 Magic Coupon (25分) The magic shop in Mars is offering some magic coupons. Each coupon has an integer N printed on it, meaning that when you use this coupon with a product, you may get N times the value of that product back! What is more, the shop als原创 2020-08-28 19:11:40 · 105 阅读 · 0 评论 -
pat 甲级 贪心 A1070 Mooncake (25分)(简单
1070 Mooncake (25分) Mooncake is a Chinese bakery product traditionally eaten during the Mid-Autumn Festival. Many types of fillings and crusts can be found in traditional mooncakes according to the region's culture. Now given the inventory amounts and the原创 2020-08-28 19:10:38 · 109 阅读 · 0 评论 -
pat 甲级 贪心 A1067 Sort with Swap(0, i) (25分)
1067 Sort with Swap(0, i) (25分) Given any permutation of the numbers {0, 1, 2,..., N−1}, it is easy to sort them in increasing order. But what if Swap(0, *) is the ONLY operation that is allowed to use? For example, to sort {4, 0, 2, 1, 3} we may apply...原创 2020-07-23 11:13:29 · 84 阅读 · 0 评论 -
pat 甲级 贪心 A1113 Integer Set Partition (25分)
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 denote the sums of all the numbers in A1原创 2020-08-24 09:13:33 · 65 阅读 · 0 评论 -
pat 甲级 贪心 A1125 Chain the Ropes (25分) (简单
1125 Chain the Ropes (25分) Given some segments of rope, you are supposed to chain them into one rope. Each time you may only fold two segments into loops and chain them into one piece, as shown by the figure. The resulting chain will be treated as another原创 2020-08-28 19:10:17 · 100 阅读 · 0 评论