上一页 1 2 3 4 5 6 7 ··· 10 下一页
摘要: 题目: M个强盗和N个村民过河, 当河的两边强盗个数多于平民个数时, 村民会被杀死; 只有一艘小船,每次最多载两个人; 0<=M<=N 在保证所有村民都不被杀死的情况下,计算总的渡河次数。 如果不能满足条件, 返回-1. 实例 输入 2 2 输出 5 第一回: 1强盗+1个村民过河, 村民回来, 此 阅读全文
posted @ 2022-08-11 16:42 麦克斯的园丁 阅读(255) 评论(0) 推荐(0) 编辑
摘要: #include <stdio.h> int main () { int a , b , i , n; printf("请输入a和b的值:\n"); scanf("%d%d", &a , &b); if(a < b) { i = b; b = a; a = i; } n = a % b; while 阅读全文
posted @ 2022-08-11 16:35 麦克斯的园丁 阅读(162) 评论(0) 推荐(0) 编辑
摘要: 正确做法: 想要了解清楚咱们岗位的薪资结构。(了解薪资) 基本薪资/绩效/提成/的占比是多少? 一年有几次调薪机会?(一个一个问,语速要慢) 综合考虑,我的薪资是8.5k(给出具体,但是要虚高一些如30%,方便HR压价,凸显目标感) 阅读全文
posted @ 2022-07-12 18:40 麦克斯的园丁 阅读(49) 评论(0) 推荐(0) 编辑
摘要: 参考: https://www.math.pku.edu.cn/teachers/lidf/docs/statcomp/html/_statcompbook/rng-uniform.html#rng-lcg https://zhuanlan.zhihu.com/p/429901476 阅读全文
posted @ 2022-06-19 17:30 麦克斯的园丁 阅读(101) 评论(0) 推荐(0) 编辑
摘要: img = skimage.io.imread(img_path) AttributeError: module 'skimage' has no attribute 'io' skimage 已经安装了 和Python的包导入机制有关。Python的包导入机制使用cpython实现,cpython 阅读全文
posted @ 2022-06-16 12:49 麦克斯的园丁 阅读(406) 评论(0) 推荐(0) 编辑
摘要: 参考:https://blog.csdn.net/FontThrone/article/details/104279224 1. 可以通过如下命令查看当前安装的版本: ll /usr/bin/gcc* 2. 安装gcc-4.8 和gcc-5: sudo apt install gcc-4.8 gcc 阅读全文
posted @ 2022-05-13 13:48 麦克斯的园丁 阅读(646) 评论(0) 推荐(0) 编辑
摘要: 参考:https://zhongqiang.blog.csdn.net/article/details/115319669 Python的heapq模块默认建立小顶堆 1. 建堆 两种方式: 一种是使用空列表,然后 heapq.heappush() 函数把值加入,另外一种是 heap.heapify 阅读全文
posted @ 2022-05-11 19:28 麦克斯的园丁 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 参考:https://zhongqiang.blog.csdn.net/article/details/115319669 class S(): def __init__(self) -> None: pass # 堆排序 def heapify(self, tree, n, i): """把父节点 阅读全文
posted @ 2022-05-11 19:00 麦克斯的园丁 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 算法题:求正实数x的平方根 69. x 的平方根 不同于LC69,面试题要求x是正实数,而不是整数。并且需要注意x可能是小数,此时x的平方根是大于x的。 二分法 https://blog.csdn.net/weixin_27625589/article/details/116221090 def m 阅读全文
posted @ 2022-05-07 09:48 麦克斯的园丁 阅读(211) 评论(0) 推荐(0) 编辑
摘要: 二分查找重点概括 https://leetcode-cn.com/problems/search-insert-position/solution/te-bie-hao-yong-de-er-fen-cha-fa-fa-mo-ban-python-/ 写成 while(left < right) , 阅读全文
posted @ 2022-05-03 21:10 麦克斯的园丁 阅读(50) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 10 下一页