小米笔试9.2 AK
选择题难度不大,
虽然该不会的就是不会
#小米##小米笔试##小米信息集散地#
结束后放代码和题解
t1 依次遍历每一项的距离,维护一个最小距离和结果,如果小于当前则更新,等于则取平均数
83%的情况,有可能是最后四舍五入的问题?我刚开始好像也遇到了这个问题,但是是elif里面写了个bug,并且需要注意需要将整数转正float类型
freq = int(input())
split = input().strip().split(',')
mx = 10**9
res = 0
for s in split:
f, l = list(map(float, s.split(':')))
if abs(freq - f) < mx:
mx = abs(freq - f)
res = l
elif abs(freq - f) == mx:
res = (res + l) / 2
print(round(res, 1))
t2 将任务按 执行结束后的剩余电量、起始电量 进行排序,然后计算
MX = 4800
task = []
least = 0
for s in input().strip().split(','):
task.append(list(map(int, s.split(':'))))
least += task[-1][0]
task.sort(key=lambda x:(-max(x[1] - x[0], 0), x[1]))
now = res = least
for cost, start in task:
d = max(cost, start) - now
if d > 0:
res += d
now += d
now -= cost
print(res if res <= MX else -1)
虽然该不会的就是不会
#小米##小米笔试##小米信息集散地#
结束后放代码和题解
t1 依次遍历每一项的距离,维护一个最小距离和结果,如果小于当前则更新,等于则取平均数
83%的情况,有可能是最后四舍五入的问题?我刚开始好像也遇到了这个问题,但是是elif里面写了个bug,并且需要注意需要将整数转正float类型
freq = int(input())
split = input().strip().split(',')
mx = 10**9
res = 0
for s in split:
f, l = list(map(float, s.split(':')))
if abs(freq - f) < mx:
mx = abs(freq - f)
res = l
elif abs(freq - f) == mx:
res = (res + l) / 2
print(round(res, 1))
t2 将任务按 执行结束后的剩余电量、起始电量 进行排序,然后计算
MX = 4800
task = []
least = 0
for s in input().strip().split(','):
task.append(list(map(int, s.split(':'))))
least += task[-1][0]
task.sort(key=lambda x:(-max(x[1] - x[0], 0), x[1]))
now = res = least
for cost, start in task:
d = max(cost, start) - now
if d > 0:
res += d
now += d
now -= cost
print(res if res <= MX else -1)
全部评论
我第二题通过率83%,不知道哪里错了
靠你们是真厉害😭两道编程我都没过,我不知道为啥我投嵌入式也发软开的卷子,选择和多选也没什么嵌入式知识点,我真不会做,我焯
受不了了,83到底是卡什么了?
中科闻歌,中科院孵化企业,解决北京户口,月薪可达30k
笔试结束之前不提供任何题解思路和代码,不要私信
java后端卷
挺简单的吧,相比其他的
可惜是海笔
确实简单
这卷子。。不论选择还是编程,感觉把不想招人写在脸上了😂毫无区分度可言啊
我想知道他这个输入输出到底是咋写,我完全看不懂输入时字符串还是整数不要标点符号
分值全在选择上,,编程就25分
66.7😰废了
能给瞅瞅代码不
相关推荐
点赞 评论 收藏
分享
01-17 10:48
南昌理工学院 Java 点赞 评论 收藏
分享


OPPO
| 校招
| 超多精选岗位
点赞 评论 收藏
分享