二分法
xiao1guaishou
这个作者很懒,什么都没留下…
展开
-
PAT A1085
题目:Given a sequence of positive integers and another positive integer p. The sequence is said to be a perfect sequence if M≤m×p where M and m are the maximum and minimum numbers in the sequence, res...原创 2019-04-06 10:55:40 · 133 阅读 · 1 评论 -
PAT A1044
题目:Shopping in Mars is quite a different experience. The Mars people pay by chained diamonds. Each diamond has a value (in Mars dollars M$). When making the payment, the chain can be cut at any pos...原创 2019-04-06 13:34:13 · 322 阅读 · 0 评论 -
PAT A1048
题目:Eva loves to collect coins from all over the universe, including some other planets like Mars. One day she visited a universal shopping mall which could accept all kinds of coins as payments. How...原创 2019-04-01 13:22:58 · 139 阅读 · 0 评论 -
PAT A1010
题目: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 of positive...原创 2019-04-07 16:39:52 · 141 阅读 · 0 评论 -
LeetCode 852
题目:我们把符合下列属性的数组 A 称作山脉:A.length >= 3存在 0 < i < A.length - 1 使得A[0] < A[1] < … A[i-1] < A[i] > A[i+1] > … > A[A.length - 1]给定一个确定为山脉的数组,返回任何满足 A[0] < A[1] < … A...原创 2019-04-07 23:21:41 · 99 阅读 · 0 评论