注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号 
x
数学题蛮简单的,如果有需要后续可以分享出来
求加大米,不会扣自己的米~
代码题:
1.
Given an array arr of n integers, in a single operation, one can choose two indices, i and j, and delete arr[i] from the array if 2 * arr[i] ≤ arr[j].
A particular element can be chosen at most once. Find the minimum possible size of the array after performing the operation any number of times, possibly zero.
Example
Suppose n= 7 and arr = [1, 2, 3, 4, 16, 32, 64]
• In the first operation, choose 1 and 16 and delete 1 from the array as 2 * 1 er of operations that can be applied to s.
Example
Consider s = "accept".
The following operations are performed. Bold indicates the changed character.
• In the original string, start at i = 2, "cce". The new string s'= "acccpt".
• Start at i = 3, s' = "acccct".
• Start at i = 4 s' = "accccc". |