
二分
二分
繁星蓝雨
Happy coding!
-
原创 第八届蓝桥杯C++B组: 分巧克力
儿童节那天有K位小朋友到小明家做客。小明拿出了珍藏的巧克力招待小朋友们。 小明一共有N块巧克力,其中第i块是Hi x Wi的方格组成的长方形。 为了公平起见,小明需要从这 N 块巧克力中切出K块巧克力分给小朋友们。切出的巧克力需要满足: 1. 形状是正方形,边长是整数 2. 大小相同 例如一块6x5的巧克力可以切出6块2x2的巧克力或者2块3x3的巧克力。 当然小朋友们都希望得到...2019-03-18 22:19:26131
0
-
原创 1044 Shopping in Mars (25 分)
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 positi...2019-03-10 21:04:5369
0
-
原创 1010 Radix (25 分)
Given a pair of positive integers, for example, 6 and 110, can this equation(方程、等式) 6 = 110 be true? The answer isyes, if 6 is a decimal number and 110 is a binary number. Now for any pair of pos...2019-03-10 15:43:26181
0
-
原创 1048 Find Coins (25 分)
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. Howev...2019-03-02 10:27:24150
0
-
原创 1029 Median (25分)
文章目录1 题目2 解析2.1 题意2.2 思路3 参考代码 1 题目 1029 Median (25分) Given an increasing sequence S of N integers, the median is the number at the middle position. For example, the median of S1 = { 11, 12, 13, 14 }...2020-03-01 10:52:3661
0
-
原创 1085 Perfect Sequence (25 分)——3种解法(二分、two pointers)
Given a sequence of positive integers and another positive integerp. The sequence is said to be aperfect sequenceifM≤m×pwhereMandmare the maximum and minimum numbers in the sequence, respe...2019-03-09 22:48:46145
0
-
原创 1089 Insert or Merge (25 分)
According to Wikipedia: Insertion sortiterates, consuming one input element each repetition, and growing a sorted output list. Each iteration, insertion sort removes one element from the input da...2019-03-11 20:54:4996
0